protected function __construct()
{
$this->app = new Container();
// Register mock instances with IoC container
$config = $this->getConfig();
$this->app->singleton('config', function () use($config) {
return $config;
});
list($connector, $manager) = $this->getDatabase();
$this->app->singleton('db.factory', function () use($connector) {
return $connector;
});
$this->app->singleton('db', function () use($manager) {
return $manager;
});
$auth = $this->getAuth();
$this->app->singleton('auth', function () use($auth) {
return $auth;
});
$dispatcher = new Dispatcher($this->app);
$this->app->singleton('events', function () use($dispatcher) {
return $dispatcher;
});
Model::setConnectionResolver($this->app['db']);
Model::setEventDispatcher($this->app['events']);
}