Exemplo n.º 1
0
 public function setUp()
 {
     DI::reset();
     $this->instance = new Dispatcher();
     $this->instance->setDI($di = new DI());
     $config = m::mock('Phalcon\\Config')->makePartial();
     $config->offsetSet('namespaces', ['controllers' => 'barFoo']);
     $di->setShared('config', $config);
     $di->setShared('router', m::mock('Phalcore\\Mvc\\Router')->makePartial());
     $this->instance->register();
 }
Exemplo n.º 2
0
 public function setUp()
 {
     DI::reset();
     DI::setDefault($di = new DI());
     $this->instance = m::mock('Phalcore\\Di\\Facade');
     $di->setShared('foo', m::mock('foo'));
 }
 public function setUp()
 {
     $this->instance = m::mock('Phalcore\\Support\\Bootstrapper\\HandleExceptions')->makePartial();
     $this->instance->setDI($di = new DI());
     $this->config = m::mock('Phalcon\\Config');
     $this->config->debug = true;
     $di->setShared('config', $this->config);
     $this->logger = m::mock('Phalcon\\Logger\\AdapterInterface')->makePartial();
     $di->setShared('logger', $this->logger);
     $this->response = m::mock('Phalcon\\Http\\Response')->makePartial();
     $di->setShared('response', $this->response);
     $this->request = m::mock('Phalcon\\Http\\Request')->makePartial();
     $di->setShared('request', $this->request);
     $this->handler = m::mock('Phalcore\\Exception\\HandlerInterface');
     $di->setShared('exceptionHandler', $this->handler);
 }
 public function setUp()
 {
     DI::reset();
     $this->instance = new LoadEnvironmentVariables();
     $this->instance->setDI($di = new DI());
     $this->application = m::mock('Phalcore\\Mvc\\Application')->makePartial();
     $di->setShared('application', $this->application);
 }
 public function setUp()
 {
     DI::reset();
     $this->instance = new ExceptionHandler();
     $this->instance->setDI($di = new DI());
     $di->setShared('config', m::mock('Phalcon\\Config'));
     $this->instance->register();
 }
Exemplo n.º 6
0
 public function setUp()
 {
     DI::reset();
     $this->instance = new Module();
     $this->instance->setDI($di = new DI());
     $di->setShared('application', m::mock('Phalcore\\Mvc\\Application')->makePartial());
     $this->instance->register();
 }
Exemplo n.º 7
0
 public function testReloadShared()
 {
     $di = new DI();
     $di->setShared('date', function () {
         return uniqid();
     });
     $this->assertEquals($di->get('date'), $di->get('date'));
     $this->assertNotEquals($di->get('date'), $di->get('date', true));
 }
 public function setUp()
 {
     DI::reset();
     $this->instance = new RegisterConfig();
     $this->instance->setDI($di = new DI());
     $this->application = m::mock('Phalcore\\Mvc\\Application')->makePartial();
     $di->setShared('application', $this->application);
     $this->instance->boot();
 }
Exemplo n.º 9
0
 public function setUp()
 {
     DI::reset();
     $this->instance = new Router();
     $this->instance->setDI($di = new DI());
     $config = m::mock('Phalcore\\Config');
     $config->files = m::mock('Phalcon\\Config');
     $config->files->routes = APP_PATH . '/config/routes.php';
     $di->setShared('config', $config);
     $this->instance->register();
 }
Exemplo n.º 10
0
 public function setUp()
 {
     DI::reset();
     $this->instance = new Logger();
     $this->instance->setDI($di = new DI());
     $config = m::mock('Phalcon\\Config');
     $config->files = m::mock('Phalcon\\Config');
     $config->files->logs = m::mock('Phalcon\\Config');
     $config->files->logs->error = APP_PATH . '/trash/foo';
     $di->setShared('config', $config);
     $this->instance->register();
 }
Exemplo n.º 11
0
 public function setUp()
 {
     DI::reset();
     $this->instance = new View();
     $this->instance->setDI($di = new DI());
     $config = m::mock('Phalcon\\Config');
     $config->paths = m::mock('Phalcon\\Config');
     $config->debug = true;
     $config->paths->cache = 'foo/cache';
     $config->paths->views = 'foo/views';
     $this->config = $config;
     $di->setShared('config', $config);
     $this->instance->register();
 }
Exemplo n.º 12
0
 public function setUp()
 {
     DI::reset();
     DI::setDefault($di = new DI());
     $di->setShared('config', $this->config = m::mock('Phalcon\\Config'));
 }