Beispiel #1
0
 public function testBefore()
 {
     $this->kernel->before(array(new KernelTestExtension()));
     try {
         $this->kernel->run();
         $this->fail();
     } catch (InvalidArgumentException $e) {
     }
 }
Beispiel #2
0
 public function before()
 {
     $root = $this->findAppFolder();
     $this->provider = new MockableProvider();
     $this->configuration = Configuration::fromFiles(array($root . '/config/config.php', $root . '/config/config-dev.php', $root . '/config/config-test.php'));
     // Create a kernel, and wrap it with an error handler
     $this->kernel = new Kernel($this->configuration, $this->provider);
     // Setting up additional components
     $this->kernel->before(array(new Extension\AllErrorsExtension(), new Extension\DoctrineExtension(require $root . '/config/models.php'), new Extension\RoutingExtension(require $root . '/config/site-routes.php'), new Extension\SessionManagerExtension(), new Extension\ThemeExtension(), new Extension\FiltersExtension('response.filters', array('themefilter' => $this->provider->proxy('MistyApp\\Filter\\ThemeFilter')))));
     // Setting up components to execute after the response has been sent
     $this->kernel->after(array(new Extension\DoctrineValidatorExtension()));
     $this->kernel->executeBefore();
 }