protected function _before() { parent::_before(); /** @var \Phalcon\Mvc\Application $app */ $app = $this->tester->getApplication(); $this->di = $app->getDI(); }
protected function _before() { parent::_before(); /** @var \Phalcon\Mvc\Application $app */ $app = $this->tester->getApplication(); $this->modelsManager = $app->getDI()->getShared('modelsManager'); }
/** * executed before each test */ protected function _before() { parent::_before(); if (!class_exists('imagick')) { $this->markTestSkipped('Warning: imagick extension is not loaded'); } }
/** * executed before each test */ protected function _before() { parent::_before(); if (!function_exists('gd_info')) { $this->markTestSkipped('Warning: gd extension is not loaded'); } }
/** * executed before each test */ public function _before() { parent::_before(); if (!extension_loaded('redis')) { $this->markTestSkipped('Warning: redis extension is not loaded'); } }
/** * executed before each test */ public function _before() { parent::_before(); if (!extension_loaded('memcache')) { $this->markTestSkipped('Warning: memcache extension is not loaded'); } }
/** * executed before each test */ protected function _before() { parent::_before(); $this->validation = new Validation(); $this->validation->add('name', new Validation\Validator\PresenceOf(['message' => 'Name cant be empty.'])); $this->validation->setFilters('name', 'trim'); }
/** * executed before each test */ public function _before() { parent::_before(); if (!function_exists('xcache_emulation') && !function_exists('xcache_get')) { $this->markTestSkipped('Warning: xcache extension is not loaded'); } require_once PATH_DATA . 'annotations/TestClass.php'; require_once PATH_DATA . 'annotations/TestClassNs.php'; }
/** * executed before each test */ public function _before() { parent::_before(); if (!function_exists('apc_fetch')) { $this->markTestSkipped('Warning: apc extension is not loaded'); } require_once PATH_DATA . 'annotations/TestClass.php'; require_once PATH_DATA . 'annotations/TestClassNs.php'; }
/** * executed before each test */ protected function _before() { parent::_before(); require_once PATH_DATA . 'di/InjectableComponent.php'; require_once PATH_DATA . 'di/SimpleComponent.php'; require_once PATH_DATA . 'di/SomeComponent.php'; Di::reset(); $this->phDi = new Di(); }
/** * executed after each test */ protected function _after() { parent::_after(); if (PHP_SESSION_ACTIVE == session_status()) { session_destroy(); } foreach ($this->sessionConfig as $key => $val) { ini_set($key, $val); } }
/** * executed before each test */ protected function _before() { parent::_before(); $di = $this->tester->getApplication()->getDI(); $di->set('modelsManager', function () { return new Manager(); }); $di->set('modelsMetadata', function () { return new Memory(); }); Di::setDefault($di); }
/** * executed after each test */ protected function _after() { parent::_after(); $loaders = spl_autoload_functions(); if (is_array($loaders)) { foreach ($loaders as $loader) { spl_autoload_unregister($loader); } } foreach ($this->loaders as $loader) { spl_autoload_register($loader); } set_include_path($this->includePath); }
/** * executed before each test */ protected function _before() { parent::_before(); if (!extension_loaded('yaml')) { $this->markTestSkipped('Warning: yaml extension is not loaded'); } if (!defined('TEST_BT_HOST') || !defined('TEST_BT_PORT')) { $this->markTestSkipped('TEST_BT_HOST and/or TEST_BT_PORT env variables are not defined'); } $this->client = new Beanstalk(['host' => TEST_BT_HOST, 'port' => TEST_BT_PORT]); try { @$this->client->connect(); } catch (\Exception $e) { $this->markTestSkipped($e->getMessage()); } }
/** * executed before each test */ public function _before() { parent::_before(); $this->logPath = PATH_OUTPUT . 'tests/logs/'; }
/** * executed before each test */ protected function _before() { parent::_before(); require_once PATH_DATA . 'di/SomeService.php'; }
/** * executed before each test */ protected function _before() { parent::_before(); Route::reset(); }
/** * executed before each test */ protected function _before() { parent::_before(); require_once PATH_DATA . 'annotations/TestClass.php'; }
/** * Initialize data for the tests */ protected function _before() { parent::_before(); $this->di = $this->tester->getApplication()->getDI(); $this->robot = new Robots(['name' => 'Robotina', 'type' => 'mechanical', 'year' => 1972, 'datetime' => (new DateTime())->format('Y-m-d H:i:s'), 'deleted' => null, 'text' => 'text']); $this->anotherRobot = new Robots(['name' => 'Robotina', 'type' => 'hydraulic', 'year' => 1952, 'datetime' => (new DateTime())->format('Y-m-d H:i:s'), 'deleted' => null, 'text' => 'text']); $this->deletedRobot = new Robots(['name' => 'Robotina', 'type' => 'mechanical', 'year' => 1972, 'datetime' => (new DateTime())->format('Y-m-d H:i:s'), 'deleted' => (new DateTime())->format('Y-m-d H:i:s'), 'text' => 'text']); }
/** * executed before each test */ protected function _before() { parent::_before(); $this->setupMongo($this->tester); }
/** * executed before each test */ public function _before() { parent::_before(); $this->config = ['ru' => ['Hello!' => 'Привет!', 'Hello %s %s %s!' => 'Привет, %s %s %s!']]; }
/** * executed before each test */ public function _before() { parent::_before(); $this->config = ['ru' => ['content' => PATH_DATA . 'translation/csv/ru_RU.csv']]; }
public function _before() { parent::_before(); $this->connection = new Mysql(['host' => TEST_DB_MYSQL_HOST, 'username' => TEST_DB_MYSQL_USER, 'password' => TEST_DB_MYSQL_PASSWD, 'dbname' => TEST_DB_MYSQL_NAME, 'port' => TEST_DB_MYSQL_PORT, 'charset' => TEST_DB_MYSQL_CHARSET]); }
public function _before() { parent::_before(); $this->connection = new Postgresql(['host' => TEST_DB_POSTGRESQL_HOST, 'username' => TEST_DB_POSTGRESQL_USER, 'password' => TEST_DB_POSTGRESQL_PASSWD, 'dbname' => TEST_DB_POSTGRESQL_NAME, 'port' => TEST_DB_POSTGRESQL_PORT, 'schema' => TEST_DB_POSTGRESQL_SCHEMA]); }