Ejemplo n.º 1
0
 protected function setUp()
 {
     parent::setUp();
     $this->mediaService = Shopware()->Container()->get('shopware_media.media_service');
     $this->testData = ['key' => 'myKey', 'name' => 'name', 'people' => ['great guy', 'greater guy', 'grumpy guy']];
     $this->testFileSize = strlen(json_encode($this->testData));
 }
Ejemplo n.º 2
0
 protected function setUp()
 {
     parent::setUp();
     Shopware()->Models()->clear();
     $this->resource = $this->createResource();
     $this->resource->setManager(Shopware()->Models());
 }
Ejemplo n.º 3
0
 /**
  * Tests set up method
  */
 public function setUp()
 {
     parent::setUp();
     $app = Enlight_Application::Instance();
     $app->Bootstrap()->resetResource('Session')->resetResource('Auth');
     $this->reset();
 }
Ejemplo n.º 4
0
 /**
  * Sets up the fixture, for example, opens a network connection.
  * This method is called before a test is executed.
  */
 protected function setUp()
 {
     parent::setUp();
     Shopware()->Models()->clear();
     $this->resource = $this->getMockForAbstractClass('\\Shopware\\Components\\Api\\Resource\\Resource');
     $this->resource->setManager(Shopware()->Models());
 }
Ejemplo n.º 5
0
 /**
  * Sets up the fixture, for example, opens a network connection.
  * This method is called before a test is executed.
  */
 protected function setUp()
 {
     parent::setUp();
     $this->em = Shopware()->Models();
     $this->repo = Shopware()->Models()->getRepository('Shopware\\Models\\Order\\Order');
     Shopware()->Bootstrap()->registerResource('Auth', new ZendAuthMock());
 }
Ejemplo n.º 6
0
 public function setUp()
 {
     $app = $this->getMock('Enlight_Application', null, array("TestApp"), '', false);
     $this->manager = $this->getMock('Enlight_Plugin_PluginManager', null, array($app));
     $this->manager->setApplication($app);
     parent::setUp();
 }
Ejemplo n.º 7
0
 /**
  * Sets up the fixture, for example, opens a network connection.
  * This method is called before a test is executed.
  */
 protected function setUp()
 {
     parent::setUp();
     $this->hasher = new \Shopware\Components\Password\Encoder\Bcrypt(array('cost' => 4));
     if (!$this->hasher->isCompatible()) {
         $this->markTestSkipped('Brypt Hasher is not compatible with current system.');
     }
 }
Ejemplo n.º 8
0
 /**
  * Set up the test case
  */
 public function setUp()
 {
     parent::setUp();
     $path = Enlight_TestHelper::Instance()->TestPath('TempFiles');
     $this->adapterTester = new Enlight_Config_Adapter_File(array('configType' => 'ini', 'configDir' => $path));
     $this->configTester = new Enlight_Config('test', array('adapter' => $this->adapterTester, 'section' => 'test'));
     $this->configTester->setAllowModifications()->set('test', true)->setReadOnly();
     $this->configTester->write();
 }
Ejemplo n.º 9
0
 /**
  * Tear down
  */
 protected function tearDown()
 {
     $esd = $this->repo->findOneBy(array('file' => '../foobar.pdf'));
     if (!empty($esd)) {
         $this->em->remove($esd);
         $this->em->flush();
     }
     parent::tearDown();
 }
Ejemplo n.º 10
0
 /**
  * Tear down
  */
 protected function tearDown()
 {
     $snippet = $this->repo->findOneBy(array('namespace' => 'unit/test/snippettestcase'));
     if (!empty($snippet)) {
         $this->em->remove($snippet);
         $this->em->flush();
     }
     parent::tearDown();
 }
Ejemplo n.º 11
0
 /**
  * Tear down
  */
 protected function tearDown()
 {
     $voucher = $this->repo->findOneBy(array('description' => 'description'));
     if (!empty($voucher)) {
         $this->em->remove($voucher);
         $this->em->flush();
     }
     parent::tearDown();
 }
Ejemplo n.º 12
0
 /**
  * Tear down
  */
 protected function tearDown()
 {
     $mail = $this->repo->findOneBy(array('name' => 'Testmail123'));
     if (!empty($mail)) {
         $this->em->remove($mail);
         $this->em->flush();
     }
     parent::tearDown();
 }
Ejemplo n.º 13
0
 /**
  * Tests set up method
  */
 public function setUp()
 {
     parent::setUp();
     $this->reset();
     Enlight_Application::Instance()->Bootstrap()->resetResource('Session')->resetResource('Auth');
     //$this->Front()
     //     ->setRequest($this->Request())
     //     ->setResponse($this->Response());
 }
Ejemplo n.º 14
0
 /**
  * Set up the test case
  */
 public function setUp()
 {
     parent::setUp();
     $tempDir = Enlight_TestHelper::Instance()->TestPath('TempFiles');
     $dataDir = Enlight_TestHelper::Instance()->TestPath('DataSets');
     $this->manager = new Enlight_Template_Manager();
     $this->manager->setCompileDir($tempDir);
     $this->manager->setCompileId('resource');
     $this->manager->setTemplateDir(array($dataDir . 'Template/parent1/', $dataDir . 'Template/parent2/'));
 }
Ejemplo n.º 15
0
 /**
  * Set up the test case
  */
 public function setUp()
 {
     parent::setUp();
     $tempDir = Enlight_TestHelper::Instance()->TestPath('TempFiles');
     $adapter = new Enlight_Config_Adapter_File(array('configType' => 'ini', 'configDir' => $tempDir, 'namePrefix' => 'snippet_'));
     $this->manager = new Enlight_Components_Snippet_Manager($adapter);
     $this->engine = new Enlight_Template_Manager();
     $this->engine->setCompileDir($tempDir);
     $this->engine->setCompileId('snippet');
     $this->engine->clearCompiledTemplate(null, 'snippet');
 }
Ejemplo n.º 16
0
 /**
  * Sets up the fixture, for example, opens a network connection.
  * This method is called before a test is executed.
  */
 protected function setUp()
 {
     parent::setUp();
     $stringCompiler = new Shopware_Components_StringCompiler(Shopware()->Template());
     $manager = $this->getMockBuilder('Shopware\\Components\\Model\\ModelManager')->disableOriginalConstructor()->getMock();
     $manager->expects($this->any())->method('getRepository')->will($this->returnSelf());
     $manager->expects($this->any())->method('findOneBy')->will($this->returnValue(false));
     $this->mail = new Shopware_Components_TemplateMail();
     $this->mail->setShop(Shopware()->Shop());
     $this->mail->setModelManager($manager);
     $this->mail->setStringCompiler($stringCompiler);
 }
Ejemplo n.º 17
0
 /**
  * Set up the test case
  */
 public function setUp()
 {
     parent::setUp();
     $dir = Enlight_TestHelper::Instance()->TestPath('TempFiles');
     $this->db = Enlight_Components_Db::factory('PDO_SQLITE', array('dbname' => $dir . 'config.db'));
     $this->db->exec('
       CREATE TABLE IF NOT EXISTS `config_test` (
           `id` INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
           `section` varchar(255) DEFAULT NULL,
           `name` varchar(255) NOT NULL,
           `value` text NOT NULL,
           `created` datetime NOT NULL,
           `updated` datetime NOT NULL
         );
     ');
 }
Ejemplo n.º 18
0
 /**
  * Set up the test case
  */
 public function setUp()
 {
     parent::setUp();
     $dir = Enlight_TestHelper::Instance()->TestPath('TempFiles');
     $this->db = Enlight_Components_Db::factory('PDO_SQLITE', array('dbname' => Enlight_TestHelper::Instance()->TestPath('TempFiles') . 'auth.db'));
     $this->lockeduntilColumn = 'lockeduntil';
     $this->createDb($this->lockeduntilColumn);
     $this->createDefaultUser($this->lockeduntilColumn);
     // Needed to simulate web environment - otherwise we would get a nasty notice.
     $GLOBALS['_SESSION'] = array();
     Zend_Session::$_unitTestEnabled = true;
     Zend_Session::start();
     $this->auth = Enlight_Components_Auth::getInstance();
     $this->authAdapter = new Enlight_Components_Auth_Adapter_DbTable($this->db, 'test_auth', 'username', 'password');
     $this->authAdapter->setIdentityColumn('username')->setCredentialColumn('password')->setExpiryColumn('lastlogin')->setSessionIdColumn('sessionID')->setSessionId('s4inr04o6apmclk7u88qau4r57');
     $storage = new Zend_Auth_Storage_Session('Enlight', 'Auth');
     $this->auth->setAdapter($this->authAdapter);
     $this->assertInstanceOf('Enlight_Components_Auth_Adapter_DbTable', $this->auth->getAdapter());
     $this->auth->setStorage($storage);
 }
Ejemplo n.º 19
0
 /**
  * Set up the test case
  */
 public function setUp()
 {
     parent::setUp();
     $dir = Enlight_TestHelper::Instance()->TestPath('TempFiles');
     $this->db = Enlight_Components_Db::factory('PDO_SQLITE', array('dbname' => $dir . 'menu.db'));
     $this->db->exec('
         DROP TABLE IF EXISTS `menu_test`;
         CREATE TABLE IF NOT EXISTS `menu_test` (
           `id` INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
           `parent` INTEGER NOT NULL,
           `active` INTEGER(1) NOT NULL,
           `label` varchar(255) NOT NULL
         );
         DROP TABLE IF EXISTS `menu_test2`;
         CREATE TABLE IF NOT EXISTS `menu_test2` (
           `id` INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
           `parent` INTEGER NOT NULL,
           `active` INTEGER(1) NOT NULL,
           `name` varchar(255) NOT NULL
         );
     ');
     $this->adapter = new Enlight_Components_Menu_Adapter_DbTable(array('db' => $this->db, 'name' => 'menu_test'));
 }
Ejemplo n.º 20
0
 /**
  * Cleaning up testData
  */
 protected function tearDown()
 {
     parent::tearDown();
     $this->module->sDeleteComparisons();
 }
Ejemplo n.º 21
0
 protected function tearDown()
 {
     $this->helper->cleanUp();
     parent::tearDown();
 }
Ejemplo n.º 22
0
 /**
  * Set up the test case
  */
 public function setUp()
 {
     parent::setUp();
     $dir = Enlight_TestHelper::Instance()->TestPath('TempFiles');
     $this->adapter = new Enlight_Config_Adapter_File(array('configType' => 'ini', 'configDir' => $dir));
 }
Ejemplo n.º 23
0
 /**
  * Set up the test case
  */
 public function setUp()
 {
     parent::setUp();
 }
Ejemplo n.º 24
0
 /**
  * Sets up the fixture, for example, opens a network connection.
  * This method is called before a test is executed.
  */
 protected function setUp()
 {
     parent::setUp();
     $this->compiler = new Shopware_Components_StringCompiler(Shopware()->Template());
 }
 /**
  * Test set up method
  */
 protected function setUp()
 {
     parent::setUp();
     $this->module = Shopware()->Modules()->Articles();
 }
Ejemplo n.º 26
0
 /**
  * Sets up the fixture, for example, opens a network connection.
  * This method is called before a test is executed.
  */
 protected function setUp()
 {
     parent::setUp();
     $this->hasher = new \Shopware\Components\Password\Encoder\Sha256(array('iterations' => 2, 'salt_len' => 22));
 }
Ejemplo n.º 27
0
 public function setUp()
 {
     $collection = $this->getMock('Enlight_Plugin_PluginCollection');
     $this->bootstrap = $this->getMock('Enlight_Plugin_Bootstrap', null, array('testBootstrap', $collection));
     parent::setUp();
 }
Ejemplo n.º 28
0
 /**
  * Sets up the fixture, for example, opens a network connection.
  * This method is called before a test is executed.
  */
 protected function setUp()
 {
     parent::setUp();
     $this->acl = Shopware()->Acl();
 }
Ejemplo n.º 29
0
 /**
  * Tearing down
  *
  * @return void
  */
 public function tearDown()
 {
     parent::tearDown();
 }
Ejemplo n.º 30
0
 /**
  * Sets up the fixture, for example, opens a network connection.
  * This method is called before a test is executed.
  * @return void
  */
 public function setUp()
 {
     $manager = $this->getMock('Enlight_Template_Manager', null, array());
     $this->view = $this->getMock('Enlight_View_Default', null, array($manager));
     parent::setUp();
 }