/** * It should automatically switch to the travis logger if the * CONTINUOUS_INTEGRATION environment variable is set. */ public function testTravisLogger() { putenv('CONTINUOUS_INTEGRATION=1'); $container = new Container(['PhpBench\\Extension\\CoreExtension'], ['path' => 'hello', 'config_path' => '/path/to/phpbench.json']); $container->init(); $this->assertEquals('travis', $container->getParameter('progress')); }
public static function run(ClassLoader $autoloader) { // Converts warnings to exceptions ErrorHandler::register(); $config = self::loadConfig(); if (isset($config['extension_autoloader']) && $config['extension_autoloader']) { $autoloadFile = $config['extension_autoloader']; if (!file_exists($autoloadFile)) { throw new \InvalidArgumentException(sprintf('Could not find extension autoload file "%s"', $autoloadFile)); } $autoloader->unregister(); include $autoloadFile; $autoloader->register(true); } $extensions = $config['extensions']; $extensions[] = 'PhpBench\\Extension\\CoreExtension'; unset($config['extensions']); $container = new Container($extensions, $config); $container->init(); $container->get('console.application')->run(); }
protected function getContainer() { $container = new Container($this->extensions, $this->config); $container->init(); return $container; }
/** * It should throw an exception if an unknown user configuration key is used. * * @expectedException InvalidArgumentException * @expectedExceptionMessage Unknown configuration keys: "not". Permitted keys: */ public function testUnknownUserConfig() { $container = new Container([], ['not' => 'existing']); $container->init(); }
public function benchInitCoreExtension() { $container = new Container(['PhpBench\\Extension\\CoreExtension']); $container->init(); }