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)); }
protected function setUp() { parent::setUp(); Shopware()->Models()->clear(); $this->resource = $this->createResource(); $this->resource->setManager(Shopware()->Models()); }
/** * Tests set up method */ public function setUp() { parent::setUp(); $app = Enlight_Application::Instance(); $app->Bootstrap()->resetResource('Session')->resetResource('Auth'); $this->reset(); }
/** * 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()); }
/** * 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()); }
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(); }
/** * 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.'); } }
/** * 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(); }
/** * 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(); }
/** * 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(); }
/** * Tear down */ protected function tearDown() { $voucher = $this->repo->findOneBy(array('description' => 'description')); if (!empty($voucher)) { $this->em->remove($voucher); $this->em->flush(); } parent::tearDown(); }
/** * Tear down */ protected function tearDown() { $mail = $this->repo->findOneBy(array('name' => 'Testmail123')); if (!empty($mail)) { $this->em->remove($mail); $this->em->flush(); } parent::tearDown(); }
/** * 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()); }
/** * 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/')); }
/** * 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'); }
/** * 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); }
/** * 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 ); '); }
/** * 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); }
/** * 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')); }
/** * Cleaning up testData */ protected function tearDown() { parent::tearDown(); $this->module->sDeleteComparisons(); }
protected function tearDown() { $this->helper->cleanUp(); parent::tearDown(); }
/** * 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)); }
/** * Set up the test case */ public function setUp() { parent::setUp(); }
/** * 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(); }
/** * 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)); }
public function setUp() { $collection = $this->getMock('Enlight_Plugin_PluginCollection'); $this->bootstrap = $this->getMock('Enlight_Plugin_Bootstrap', null, array('testBootstrap', $collection)); parent::setUp(); }
/** * 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(); }
/** * Tearing down * * @return void */ public function tearDown() { parent::tearDown(); }
/** * 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(); }