コード例 #1
0
ファイル: BuilderTest.php プロジェクト: phalcon/cphalcon
 protected function _before()
 {
     parent::_before();
     /** @var \Phalcon\Mvc\Application $app */
     $app = $this->tester->getApplication();
     $this->di = $app->getDI();
 }
コード例 #2
0
ファイル: ManagerTest.php プロジェクト: mattvb91/cphalcon
 protected function _before()
 {
     parent::_before();
     /** @var \Phalcon\Mvc\Application $app */
     $app = $this->tester->getApplication();
     $this->modelsManager = $app->getDI()->getShared('modelsManager');
 }
コード例 #3
0
ファイル: ImagickTest.php プロジェクト: mattvb91/cphalcon
 /**
  * executed before each test
  */
 protected function _before()
 {
     parent::_before();
     if (!class_exists('imagick')) {
         $this->markTestSkipped('Warning: imagick extension is not loaded');
     }
 }
コード例 #4
0
ファイル: GdTest.php プロジェクト: mattvb91/cphalcon
 /**
  * executed before each test
  */
 protected function _before()
 {
     parent::_before();
     if (!function_exists('gd_info')) {
         $this->markTestSkipped('Warning: gd extension is not loaded');
     }
 }
コード例 #5
0
ファイル: RedisTest.php プロジェクト: mattvb91/cphalcon
 /**
  * executed before each test
  */
 public function _before()
 {
     parent::_before();
     if (!extension_loaded('redis')) {
         $this->markTestSkipped('Warning: redis extension is not loaded');
     }
 }
コード例 #6
0
ファイル: MemcacheTest.php プロジェクト: mattvb91/cphalcon
 /**
  * executed before each test
  */
 public function _before()
 {
     parent::_before();
     if (!extension_loaded('memcache')) {
         $this->markTestSkipped('Warning: memcache extension is not loaded');
     }
 }
コード例 #7
0
ファイル: ValidationTest.php プロジェクト: phalcon/cphalcon
 /**
  * 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');
 }
コード例 #8
0
ファイル: LoaderTest.php プロジェクト: mattvb91/cphalcon
 /**
  * executed before each test
  */
 protected function _before()
 {
     parent::_before();
     $this->loaders = spl_autoload_functions();
     if (!is_array($this->loaders)) {
         $this->loaders = [];
     }
     $this->includePath = get_include_path();
 }
コード例 #9
0
ファイル: XcacheTest.php プロジェクト: mattvb91/cphalcon
 /**
  * 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';
 }
コード例 #10
0
ファイル: ApcTest.php プロジェクト: mattvb91/cphalcon
 /**
  * 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';
 }
コード例 #11
0
ファイル: DiTest.php プロジェクト: phalcon/cphalcon
 /**
  * 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();
 }
コード例 #12
0
ファイル: CriteriaTest.php プロジェクト: phalcon/cphalcon
 /**
  * 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);
 }
コード例 #13
0
ファイル: BeanstalkBase.php プロジェクト: mattvb91/cphalcon
 /**
  * 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());
     }
 }
コード例 #14
0
ファイル: FilesTest.php プロジェクト: mattvb91/cphalcon
 /**
  * executed before each test
  */
 protected function _before()
 {
     parent::_before();
     $this->sessionConfig = ['save_handler' => ini_get('session.save_handler'), 'save_path' => ini_get('session.save_path'), 'serialize_handler' => ini_get('session.serialize_handler')];
 }
コード例 #15
0
ファイル: FileTest.php プロジェクト: mattvb91/cphalcon
 /**
  * executed before each test
  */
 public function _before()
 {
     parent::_before();
     $this->logPath = PATH_OUTPUT . 'tests/logs/';
 }
コード例 #16
0
ファイル: ServiceTest.php プロジェクト: mattvb91/cphalcon
 /**
  * executed before each test
  */
 protected function _before()
 {
     parent::_before();
     require_once PATH_DATA . 'di/SomeService.php';
 }
コード例 #17
0
ファイル: RouterTest.php プロジェクト: phalcon/cphalcon
 /**
  * executed before each test
  */
 protected function _before()
 {
     parent::_before();
     Route::reset();
 }
コード例 #18
0
ファイル: ReflectionTest.php プロジェクト: mattvb91/cphalcon
 /**
  * executed before each test
  */
 protected function _before()
 {
     parent::_before();
     require_once PATH_DATA . 'annotations/TestClass.php';
 }
コード例 #19
0
ファイル: UniquenessTest.php プロジェクト: mattvb91/cphalcon
 /**
  * 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']);
 }
コード例 #20
0
ファイル: CollectionTest.php プロジェクト: phalcon/cphalcon
 /**
  * executed before each test
  */
 protected function _before()
 {
     parent::_before();
     $this->setupMongo($this->tester);
 }
コード例 #21
0
 /**
  * executed before each test
  */
 public function _before()
 {
     parent::_before();
     $this->config = ['ru' => ['Hello!' => 'Привет!', 'Hello %s %s %s!' => 'Привет, %s %s %s!']];
 }
コード例 #22
0
ファイル: CsvTest.php プロジェクト: phalcon/cphalcon
 /**
  * executed before each test
  */
 public function _before()
 {
     parent::_before();
     $this->config = ['ru' => ['content' => PATH_DATA . 'translation/csv/ru_RU.csv']];
 }
コード例 #23
0
ファイル: MysqlTest.php プロジェクト: phalcon/cphalcon
 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]);
 }
コード例 #24
0
ファイル: PostgresqlTest.php プロジェクト: phalcon/cphalcon
 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]);
 }