/** * Provides a HttpClient based on the Graviton\AppKernel * * @todo why are we not using createClient from SymWebTestCase? This need fixing or an explanation. * * @param array $options environment and debug option for kernel * @param array $server server params * * @return \Symfony\Bundle\FrameworkBundle\Client */ protected static function createClient(array $options = array(), array $server = array()) { WebTestCase::ensureKernelShutdown(); if (null === KernelTestCase::$class) { KernelTestCase::$class = '\\Graviton\\' . static::getKernelClass(); } WebTestCase::$kernel = new WebTestCase::$class(isset($options['environment']) ? $options['environment'] : 'test', isset($options['debug']) ? $options['debug'] : true); WebTestCase::$kernel->setBundleLoader(new BundleLoader(new GravitonBundleBundle())); WebTestCase::$kernel->boot(); $client = WebTestCase::$kernel->getContainer()->get('test.client'); $client->setServerParameters($server); return $client; }