public function testCreateWithConfigClosure()
{
$config = $this->config;
$config->addArgument('argument');
$config->addOption('option', 'o');
// This feature is useful when the Config constructor might throw an
// exception which should be rendered nicely
$application = new ConsoleApplication(function () use($config) {
return $config;
});
$this->assertSame($this->config, $application->getConfig());
$this->assertEquals(new ArgsFormat(array(new Argument('argument'), new Option('option', 'o'))), $application->getGlobalArgsFormat());
}