示例#1
0
 /**
  * Constructor
  *
  * @param ServiceContainer            container
  * @param ApplicationInterface        $app
  * @param ControllerResolverInterface $resolver
  */
 public function __construct(ServiceContainer $container, ApplicationInterface $app, ControllerResolverInterface $resolver)
 {
     $this->container = $container;
     $this->resolver = $resolver;
     $this->container->setApp($app);
     $this->loadConfig()->loadRouting();
     $this->container->setConfig($app->getConfig());
     $this->dispatchEvent(KernelEvents::APP_LOADED, new KernelEvent($container));
     $this->container['kernel'] = $this;
     parent::__construct($this->container['core']['dispatcher'], $resolver);
 }
示例#2
0
 /**
  * Sets up the fixture, for example, opens a network connection.
  * This method is called before a test is executed.
  */
 protected function setUp()
 {
     $this->container = new Servicecontainer();
     $this->container->setApp(new Application())->setConfig(new Config());
     $this->container->register(new ServiceCommandProvider());
 }