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(); }
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(); }
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(); }
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(); }
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(); }
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(); }
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(); }
public function setUp() { DI::reset(); DI::setDefault($di = new DI()); $di->setShared('config', $this->config = m::mock('Phalcon\\Config')); }