示例#1
0
 public function setUp()
 {
     $this->kernel = new \AppKernel('test', true);
     $this->kernel->boot();
     $this->container = $this->kernel->getContainer();
     parent::setUp();
 }
 /**
  * @BeforeSuite
  */
 public static function bootstrapApp()
 {
     // required so that we get the doctrine annotations stuff from that file loaded in
     require __DIR__ . '/../../app/autoload.php';
     require __DIR__ . '/../../app/AppKernel.php';
     self::$kernel = new \AppKernel('test', true);
     self::$kernel->boot();
 }
示例#3
0
 public function __construct(PHP_CodeCoverage_Driver $driver = NULL, PHP_CodeCoverage_Filter $filter = NULL)
 {
     require $_SERVER['KERNEL_DIR'] . '/AppKernel.php';
     $this->appKernel = new \AppKernel('test', true);
     $this->appKernel->boot();
     $this->twig = $this->appKernel->getContainer()->get('twig');
     $this->twigCacheRegex = '#^' . $this->twig->getCache() . '/././([0-9a-f]+)\\.php$#';
     $filter->addDirectoryToWhitelist($this->twig->getCache());
     parent::__construct($driver, $filter);
 }
示例#4
0
 /**
  * Construct a test case.
  */
 public function __construct()
 {
     parent::__construct();
     self::$kernel = new \AppKernel('test', true);
     self::$kernel->boot();
     self::$application = new Application(self::$kernel);
     self::$application->setAutoExit(false);
     self::$container = self::$kernel->getContainer();
     self::$doctrine = $this->get('doctrine');
 }
示例#5
0
 protected function bootApp()
 {
     if (!$this->booted) {
         $this->app->setConfig(['parameters' => ['facade.aliases' => $this->aliases]]);
         if ($this->isServiceLocatorSet) {
             $this->app->addBundle($this->getFacadeBundle());
             //$this->app->register($this->getFacadeProvider(), ['facade.aliases' => $this->aliases]);
         }
         $this->app->boot();
         //handle(Request::createFromGlobals());
         $this->booted = true;
     }
 }
 protected static function bootstrapApplication()
 {
     $kernel = new \AppKernel(static::$environment, static::$debug);
     $kernel->boot();
     static::$application = new Application($kernel);
     static::$application->setAutoExit(false);
 }
示例#7
0
 public function __construct()
 {
     $kernel = new \AppKernel("test", true);
     $kernel->boot();
     $this->_container = $kernel->getContainer();
     $this->searchEngine = $this->get('beecms.search.service');
 }
示例#8
0
 private function buildKernel()
 {
     require_once __DIR__ . "/../../../../../app/AppKernel.php";
     $kernel = new \AppKernel("test", true);
     $kernel->boot();
     return $kernel;
 }
 protected function setUp()
 {
     $kernel = new \AppKernel('test', true);
     $kernel->boot();
     $this->container = $kernel->getContainer();
     $this->youtube = $this->container->get('awy.google.youtube');
 }
 public function __construct()
 {
     $kernel = new AppKernel('test', true);
     $kernel->boot();
     $this->em = $kernel->getContainer()->get('doctrine.orm.entity_manager');
     $this->kernel = $kernel;
 }
 public static function setUpBeforeClass()
 {
     @unlink(__DIR__ . '/../Fixtures/Test/TestBundle/Resources/config/routing.rest.yml');
     @unlink(__DIR__ . '/../Fixtures/Test/TestBundle/Controller/CarController.php');
     @unlink(__DIR__ . '/../Fixtures/Test/TestBundle/Controller/OrderController.php');
     $kernel = new \AppKernel('test', true);
     $app = new Application($kernel);
     $app->addCommands(array(new GenerateRestControllerCommand()));
     $kernel->boot();
     $command = $app->find('generate:rest:controller');
     $commandTester = new CommandTester($command);
     $commandTester->execute(array('command' => $command->getName(), '--controller' => 'TestTestBundle:Order', '--entity' => 'TestTestBundle:Order', '--mongo' => true), array('interactive' => false));
     $kernel->shutdown();
     $kernel = new \AppKernel('test', true);
     $app = new Application($kernel);
     $app->addCommands(array(new GenerateRestControllerCommand()));
     $kernel->boot();
     $command = $app->find('generate:rest:controller');
     $commandTester = new CommandTester($command);
     $commandTester->execute(array('command' => $command->getName(), '--controller' => 'TestTestBundle:Car', '--entity' => 'TestTestBundle:Car'), array('interactive' => false));
     $kernel->shutdown();
     @unlink(__DIR__ . '/../app/cache/test/appTestUrlGenerator.php.meta');
     @unlink(__DIR__ . '/../app/cache/test/appTestUrlGenerator.php');
     @unlink(__DIR__ . '/../app/cache/test/appTestUrlMatcher.php.meta');
     @unlink(__DIR__ . '/../app/cache/test/appTestUrlMatcher.php');
 }
示例#12
0
 public function __construct()
 {
     $kernel = new \AppKernel("test", true);
     $kernel->boot();
     $this->container = $kernel->getContainer();
     parent::__construct();
 }
示例#13
0
 public function setUp()
 {
     $kernel = new \AppKernel('test', true);
     $kernel->boot();
     $this->container = $kernel->getContainer();
     $this->service = $this->container->get('dugun_upload.service.upload_service');
 }
示例#14
0
 protected function setUp()
 {
     $kernel = new \AppKernel('test', false);
     $kernel->boot();
     $this->articleRepository = $kernel->getContainer()->get('app.article_repository');
     $this->queryBus = $kernel->getContainer()->get('gnugat_query_bus.query_bus');
 }
 public static function setUpBeforeClass()
 {
     require_once "{$_SERVER['KERNEL_DIR']}/AppKernel.php";
     $kernel = new \AppKernel('test', true);
     $kernel->boot();
     self::$validator = $kernel->getContainer()->get('validator');
 }
示例#16
0
 private function loadSf2()
 {
     global $kernel;
     //@settings_fields('wp_symfony_settings');
     //@do_settings_fields('wp_symfony_settings');
     $path = get_option('symfony2_path');
     $env = get_option('symfony2_env');
     $url = get_option('symfony2_url');
     if (!$this->isValidSymfonyPath($path)) {
         add_action('admin_footer', array($this, 'symfony2_warning'));
         return;
     }
     if ($kernel == null) {
         $loader = (require_once $path . 'app/bootstrap.php.cache');
         require_once $path . 'app/AppKernel.php';
         $kernel = new AppKernel($env, true);
         $kernel->loadClassCache();
         $kernel->boot();
         $this->kernel = $kernel;
         $this->container = $kernel->getContainer();
         if ($this->container->get('session')->isStarted() == false) {
             $this->container->get('session')->start();
         }
         if ($url != null) {
             $this->overloadUrlContext($url);
         }
     } else {
         $this->kernel = $kernel;
         $this->container = $kernel->getContainer();
     }
     $wp_loader = $this->container->get('wordpress.loader');
     $wp_loader->load();
 }
 protected function setUp()
 {
     $kernel = new \AppKernel('test', false);
     $kernel->boot();
     $application = new Application($kernel);
     $application->setAutoExit(false);
     $this->applicationTester = new ApplicationTester($application);
 }
示例#18
0
 public function testSearchFocusSkill_FF()
 {
     $kernel = new \AppKernel('test_FF', true);
     $kernel->boot();
     $crawler = $this->client->request('GET', '/search');
     $this->assertTrue($crawler->filter('html:contains("Focus")')->count() == 0);
     $this->assertTrue($crawler->filter('html:contains("Skill")')->count() == 0);
 }
 /**
  * {@inheritDoc}
  */
 protected function setUp()
 {
     $this->logger = $this->getMock('Symfony\\Bridge\\Monolog\\Logger', ['log'], ['name' => 'console.chain']);
     $kernel = new \AppKernel('test', false);
     $this->application = new Application($kernel);
     $this->application->setAutoExit(false);
     $kernel->boot();
     $kernel->getContainer()->set('chain_command.logger', $this->logger);
 }
 /**
  * Да да, тот самый контейнер, про который вы подумали
  *
  * @return mixed
  */
 protected function getContainer()
 {
     if (!$this->container) {
         $kernel = new \AppKernel('prod', false);
         $kernel->boot();
         $this->container = $kernel->getContainer();
     }
     return $this->container;
 }
示例#21
0
 public function setUp()
 {
     $kernel = new \AppKernel("test", true);
     $kernel->boot();
     $this->_application = new \Symfony\Bundle\FrameworkBundle\Console\Application($kernel);
     $this->_application->setAutoExit(false);
     $this->runConsole("doctrine:schema:drop", array("--force" => true));
     $this->runConsole("doctrine:schema:create");
 }
示例#22
0
 public static function bootKernel()
 {
     $loader = (require_once __DIR__ . '/../../../../app/bootstrap.php.cache');
     Debug::enable();
     require_once __DIR__ . '/../../../../app/AppKernel.php';
     $kernel = new \AppKernel('dev', true);
     $kernel->loadClassCache();
     $kernel->boot();
     return $kernel;
 }
示例#23
0
 private function client()
 {
     $kernel = new AppKernel('test', false);
     $kernel->boot();
     $client = $kernel->getContainer()->get('test.client');
     $crawler = $client->request('GET', '/login');
     $form = $crawler->filter('form')->form(array('_username' => $this->username, '_password' => $this->password));
     $client->submit($form);
     $client->followRedirect();
     return $client;
 }
示例#24
0
 /**
  * {@inheritdoc}
  */
 public function boot()
 {
     $this->purgeSymfonyCache();
     if ($this->canBootRealSystem()) {
         parent::boot();
         $this->bootRealSystem();
     } else {
         $this->initializeBundles();
         $this->bootHelperSystem();
     }
 }
示例#25
0
 public function testExecute()
 {
     $kernel = new \AppKernel('test', true);
     $kernel->boot();
     $application = new Application($kernel);
     $application->add(new CopyCommand());
     $command = $application->find('kl3sk:chosen:copy');
     $commandTester = new CommandTester($command);
     $commandTester->execute(array('command' => $command->getName()));
     $this->assertRegExp('/Your files have been copied to Kl3skChosenBundle/', $commandTester->getDisplay());
 }
 public function setUp()
 {
     $kernel = new \AppKernel('test', true);
     $kernel->boot();
     $this->_application = new \Symfony\Bundle\FrameworkBundle\Console\Application($kernel);
     $this->_application->setAutoExit(false);
     $this->runConsole("doctrine:schema:drop", array("--force" => true));
     $this->runConsole("doctrine:schema:create");
     $this->runConsole("cache:warmup");
     //$this->runConsole("doctrine:fixtures:load", array("--fixtures" => __DIR__ . "/../DataFixtures"));
 }
 public function testGenerator()
 {
     $filesystem = new Filesystem();
     $path = sys_get_temp_dir() . '/' . uniqid();
     $filesystem->remove($path);
     $bundle = $this->getBundle($path);
     $kernel = new \AppKernel('phpunit', true);
     $kernel->boot();
     $generator = new DefaultSiteGenerator($filesystem, $this->getRegistry(), '/defaultsite', $this->getAssistant(), $kernel->getContainer());
     $generator->generate($bundle, '', __DIR__ . '/../data', false);
 }
 public static function tearDownAfterClass()
 {
     parent::tearDownAfterClass();
     $kernel = new \AppKernel('test', true);
     $app = new Application($kernel);
     $app->addCommands(array(new DropSchemaDoctrineODMCommand()));
     $kernel->boot();
     $command = $app->find('doctrine:mongodb:schema:drop');
     $commandTester = new CommandTester($command);
     $commandTester->execute(array('command' => $command->getName()));
     $kernel->shutdown();
 }
 public static function tearDownAfterClass()
 {
     parent::tearDownAfterClass();
     $kernel = new \AppKernel('test', true);
     $app = new Application($kernel);
     $app->addCommands(array(new DropDatabaseDoctrineCommand()));
     $kernel->boot();
     $command = $app->find('doctrine:database:drop');
     $commandTester = new CommandTester($command);
     $commandTester->execute(array('command' => $command->getName(), '--force' => true));
     $kernel->shutdown();
 }
 public function __construct()
 {
     require_once __DIR__ . '/../../app/bootstrap.php.cache';
     require_once __DIR__ . '/../../app/AppKernel.php';
     $kernel = new \AppKernel('test', true);
     $kernel->boot();
     register_shutdown_function(function () {
         if ($error = error_get_last()) {
             var_dump(array_merge($error, ['class' => get_called_class()]));
         }
     });
     $this->container = $kernel->getContainer();
 }