Inheritance: extends PHPUnit_Framework_TestCase
 public function setUp()
 {
     // Load any additional services that might be required during testing
     $di = DI::getDefault();
     // get any DI components here, if you have a config, be sure to pass it to the parent
     parent::setUp($di);
     $this->_loaded = true;
 }
 public function setUp(Phalcon\DiInterface $di = NULL, Phalcon\Config $config = NULL)
 {
     // Загрузка дополнительных сервисов, которые могут потребоваться во время тестирования
     $di = DI::getDefault();
     // получаем любые компоненты DI, если у вас есть настройки, не забудьте передать их родителю
     parent::setUp($di);
     $this->_loaded = true;
 }
 protected function setUp(DIC $di = NULL, Config $config = NULL)
 {
     // create a new DI container
     //
     $bootstrap = new \Lib\Bootstrap\Unit(array('url', 'cookies', 'session', 'profiler', 'db', 'mongo', 'collectionManager', 'dataCache', 'util', 'auth', 'validate', 'cache'));
     $bootstrap->run();
     parent::setUp($bootstrap->getDI());
 }
Beispiel #4
0
 public function setUp(Phalcon\DiInterface $di = NULL, Phalcon\Config $config = NULL)
 {
     // Load any additional services that might be required during testing
     $di = DI::getDefault();
     // get any DI components here. If you have a config, be sure to pass it to the parent
     parent::setUp($di);
     $this->_loaded = true;
 }
 public function setUp(\Phalcon\DiInterface $di = null, \Phalcon\Config $config = null)
 {
     // Load any additional services that might be required during testing
     $di = DI::getDefault();
     $this->application = new Application($di);
     // get any DI components here. If you have a config, be sure to pass it to the parent
     parent::setUp($this->application->di, $this->application->config);
     $this->_loaded = true;
 }
Beispiel #6
0
 public function setUp()
 {
     parent::setUp();
     $this->di->set('filter', function () {
         return new \Phalcon\Filter();
     });
     $this->request = new PhRequest();
     $this->request->setDI($this->di);
 }
 public function setUp()
 {
     parent::setUp();
     // Загрузка дополнительных сервисов, которые могут потребоваться во время тестирования
     $di = Di::getDefault();
     // получаем любые компоненты DI, если у вас есть настройки, не забудьте передать их родителю
     $this->setDi($di);
     $this->_loaded = true;
 }
Beispiel #8
0
 /**
  * Sets the test up by loading the DI container and other stuff
  *
  * @author Nikos Dimopoulos <*****@*****.**>
  * @since  2012-09-20
  *
  * @param  \Phalcon\DiInterface $di
  * @param  \Phalcon\Config $config
  *
  * @return void
  */
 protected function setUp(\Phalcon\DiInterface $di = null, \Phalcon\Config $config = null)
 {
     parent::setUp($di, $config);
     // Set Models manager
     $this->di->set('modelsManager', function () {
         return new PhModelManager();
     });
     // Set Models metadata
     $this->di->set('modelsMetadata', function () {
         return new PhMetadataMemory();
     });
     // Set the connection to the db (defaults to mysql)
     $this->setDb();
 }
Beispiel #9
0
 /**
  * This method is called before a test is executed.
  */
 protected function setUp()
 {
     parent::setUp();
     // Set Models manager
     $this->di->set('modelsManager', function () {
         return new PhModelManager();
     });
     // Set Models metadata
     $this->di->set('modelsMetadata', function () {
         return new PhMetadataMemory();
     });
     // Set the connection to the db (defaults to mysql)
     $this->setDb();
 }
Beispiel #10
0
 /**
  * Sets the environment
  */
 public function setUp()
 {
     parent::setUp();
     $this->di->set('router', function () {
         $router = new PhRouter(false);
         $router->add('/admin/:controller/p/:action', array('controller' => 1, 'action' => 2))->setName('adminProducts');
         $router->add('/api/classes/{class}')->setName('classApi');
         $router->add('/{year}/{month}/{title}')->setName('blogPost');
         $router->add('/wiki/{article:[a-z]+}')->setName('wikipedia');
         $router->add('/news/{country:[a-z]{2}}/([a-z+])/([a-z\\-+])/{page}', array('section' => 2, 'article' => 3))->setName('news');
         $router->add('/([a-z]{2})/([a-zA-Z0-9_-]+)(/|)', array('lang' => 1, 'module' => 'main', 'controller' => 2, 'action' => 'index'))->setName('lang-controller');
         return $router;
     });
 }
Beispiel #11
0
 public function setUp(\Phalcon\DiInterface $di = NULL, \Phalcon\Config $config = NULL)
 {
     // Load any additional services that might be required during testing
     $di = DI::getDefault();
     // get any DI components here. If you have a config, be sure to pass it to the parent
     $config = (include __DIR__ . "/../apps/config/config.php");
     /**
      * Database connection is created based in the parameters defined in the configuration file
      */
     $di['db'] = function () use($config) {
         return new DbAdapter(array("host" => $config->database->host, "username" => $config->database->username, "password" => $config->database->password, "dbname" => $config->database->dbname));
     };
     parent::setUp($di);
     $this->_loaded = true;
 }
 public function setUp()
 {
     parent::setUp();
     // Load any additional services that might be required during testing
     $di = Di::getDefault();
     // Get any DI components here. If you have a config, be sure to pass it to the parent
     $di->set('modelsManager', function () {
         return new ModelsManager();
     });
     $di->set('modelsMetadata', new MetaData());
     $db = new Connection(array("dbname" => "testing.db"));
     $di->set('db', $db);
     $this->setDi($di);
     $this->_loaded = true;
 }
Beispiel #13
0
 public function setUp(Phalcon\DiInterface $di = NULL, Phalcon\Config $config = NULL)
 {
     // Load any additional services that might be required during testing
     include __DIR__ . '/../config/services.php';
     include __DIR__ . '/../config/loader.php';
     // $di = DI::getDefault();
     // get any DI components here. If you have a config, be sure to pass it to the parent
     $di->set('dispatcher', function () {
         $dispatcher = new Phalcon\Mvc\Dispatcher();
         $dispatcher->setControllerName($this->_ctrl);
         $dispatcher->setActionName($this->_act);
         return $dispatcher;
     }, true);
     $this->di = $di;
     parent::setUp($di);
     $this->_loaded = true;
 }
 public function setUp(DiInterface $di = NULL, Config $config = NULL)
 {
     parent::setUp(DI::getDefault());
 }
 public function setUp()
 {
     parent::setUp();
     $this->dispatcher = $this->di->getDispatcher();
     $this->router = new Router(false);
 }
 public function setUp(Phalcon\DiInterface $di = NULL, Phalcon\Config $config = NULL)
 {
     $di = DI::getDefault();
     parent::setUp($di);
     $this->_loaded = true;
 }
Beispiel #17
0
 /**
  * Initialization of variables etc.
  *
  * @return Phalcon\DI|void
  */
 public function setUp()
 {
     parent::setUp();
     $this->logPath = PATH_LOGS;
 }