当前位置: 首页>>代码示例>>PHP>>正文


PHP WebTestCase::createKernel方法代码示例

本文整理汇总了PHP中Symfony\Bundle\FrameworkBundle\Test\WebTestCase::createKernel方法的典型用法代码示例。如果您正苦于以下问题:PHP WebTestCase::createKernel方法的具体用法?PHP WebTestCase::createKernel怎么用?PHP WebTestCase::createKernel使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Symfony\Bundle\FrameworkBundle\Test\WebTestCase的用法示例。


在下文中一共展示了WebTestCase::createKernel方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: getCommand

 protected function getCommand()
 {
     $kernel = WebTestCase::createKernel();
     $application = new Application($kernel);
     $adapter = new SymfonyFinder();
     $application->add(new FindCommand($adapter));
     return $application->find('fsearch:find');
 }
开发者ID:alexkomaralex,项目名称:file-search-bundle,代码行数:8,代码来源:FindCommandSymfonyFinderTest.php

示例2: createKernel

 /**
  * {@inheritDoc}
  *
  * This is overriden to set the default environment to 'rctest'
  */
 protected static function createKernel(array $options = array())
 {
     // default environment is 'rctest'
     if (!isset($options['environment'])) {
         $options['environment'] = 'default.yml';
     }
     return parent::createKernel($options);
 }
开发者ID:krixer,项目名称:ServiredBundle,代码行数:13,代码来源:BaseTestCase.php

示例3: runCommand

 public function runCommand(Client $client, $command)
 {
     $application = new Application(WebTestCase::createKernel());
     $application->setAutoExit(false);
     $fp = tmpfile();
     $input = new StringInput($command);
     $output = new StreamOutput($fp);
     $application->run($input, $output);
     fseek($fp, 0);
     $output = '';
     while (!feof($fp)) {
         $output = fread($fp, 4096);
     }
     fclose($fp);
     return $output;
 }
开发者ID:igrizzli,项目名称:file-search-bundle,代码行数:16,代码来源:FindFileCommandTest.php

示例4: createKernel

 /**
  * {@inheritdoc}
  */
 protected static function createKernel(array $options = array())
 {
     global $_SERVER;
     // "MONOLITH_TEST_SUITE" variable can be set by a script which initiates running tests to signal
     // that this is a monolith repository, that is - the repository contains functional tests
     // for different bundles and in scope of one test run there's a chance that many app kernel instances
     // will be instantiated and as result we want to avoid in-memory caching (this is what original
     // "createClient" method actually does). In-memory caching speeds up test run but at the same
     // time might in case of monolithic repositories will lead to re-using of wrong app kernels
     $isMonolithTestSuite = isset($_SERVER['MONOLITH_TEST_SUITE']) && $_SERVER['MONOLITH_TEST_SUITE'];
     if ($isMonolithTestSuite) {
         static::$class = static::getKernelClass();
         return new static::$class(isset($options['environment']) ? $options['environment'] : 'test', isset($options['debug']) ? $options['debug'] : true);
     } else {
         // letting to use runtime-caching
         return parent::createKernel($options);
     }
 }
开发者ID:modera,项目名称:foundation,代码行数:21,代码来源:FunctionalTestCase.php


注:本文中的Symfony\Bundle\FrameworkBundle\Test\WebTestCase::createKernel方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。