Ejemplo n.º 1
0
 /**
  * @param ContainerInterface $container
  */
 public function __construct(ContainerInterface $container = null)
 {
     if (null === $container) {
         $container = new Container();
     }
     $this->relayBuilder = new RelayBuilder();
     $this->container = $container;
     $this->errorHandler = $container->get(Handler\ErrorInterface::class);
     $this->notFoundHandler = $container->get(Handler\NotFoundInterface::class);
     $this->view = $container->get(View\Manager::class);
 }
Ejemplo n.º 2
0
 /**
  * @param ContainerInterface $container
  */
 public function __construct(ContainerInterface $container = null)
 {
     if (null === $container) {
         $container = new Container();
         $container->addServiceProvider(new ServiceProvider());
     }
     $this->router = new Router();
     $this->serviceContainer = $container;
     $this->viewManager = $container->get(View\Manager::class);
 }
Ejemplo n.º 3
0
 /**
  * @return EntityManager
  */
 protected function em()
 {
     return $this->container->get(EntityManager::class);
 }
Ejemplo n.º 4
0
 /**
  * @dataProvider instanceProvider
  * @param string $class
  */
 public function testInstances($class)
 {
     $this->assertInstanceOf($class, $this->container->get($class));
 }