Update vendored libs
This commit is contained in:
@@ -89,19 +89,19 @@ abstract class AbstractDescriptorTest extends TestCase
|
||||
|
||||
protected function getDescriptionTestData(array $objects)
|
||||
{
|
||||
$data = array();
|
||||
$data = [];
|
||||
foreach ($objects as $name => $object) {
|
||||
$description = file_get_contents(sprintf('%s/../Fixtures/%s.%s', __DIR__, $name, $this->getFormat()));
|
||||
$data[] = array($object, $description);
|
||||
$data[] = [$object, $description];
|
||||
}
|
||||
|
||||
return $data;
|
||||
}
|
||||
|
||||
protected function assertDescription($expectedDescription, $describedObject, array $options = array())
|
||||
protected function assertDescription($expectedDescription, $describedObject, array $options = [])
|
||||
{
|
||||
$output = new BufferedOutput(BufferedOutput::VERBOSITY_NORMAL, true);
|
||||
$this->getDescriptor()->describe($output, $describedObject, $options + array('raw_output' => true));
|
||||
$this->getDescriptor()->describe($output, $describedObject, $options + ['raw_output' => true]);
|
||||
$this->assertEquals(trim($expectedDescription), trim(str_replace(PHP_EOL, "\n", $output->fetch())));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -26,10 +26,10 @@ class JsonDescriptorTest extends AbstractDescriptorTest
|
||||
return 'json';
|
||||
}
|
||||
|
||||
protected function assertDescription($expectedDescription, $describedObject, array $options = array())
|
||||
protected function assertDescription($expectedDescription, $describedObject, array $options = [])
|
||||
{
|
||||
$output = new BufferedOutput(BufferedOutput::VERBOSITY_NORMAL, true);
|
||||
$this->getDescriptor()->describe($output, $describedObject, $options + array('raw_output' => true));
|
||||
$this->getDescriptor()->describe($output, $describedObject, $options + ['raw_output' => true]);
|
||||
$this->assertEquals(json_decode(trim($expectedDescription), true), json_decode(trim(str_replace(PHP_EOL, "\n", $output->fetch())), true));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -21,7 +21,7 @@ class MarkdownDescriptorTest extends AbstractDescriptorTest
|
||||
{
|
||||
return $this->getDescriptionTestData(array_merge(
|
||||
ObjectsProvider::getCommands(),
|
||||
array('command_mbstring' => new DescriptorCommandMbString())
|
||||
['command_mbstring' => new DescriptorCommandMbString()]
|
||||
));
|
||||
}
|
||||
|
||||
@@ -29,7 +29,7 @@ class MarkdownDescriptorTest extends AbstractDescriptorTest
|
||||
{
|
||||
return $this->getDescriptionTestData(array_merge(
|
||||
ObjectsProvider::getApplications(),
|
||||
array('application_mbstring' => new DescriptorApplicationMbString())
|
||||
['application_mbstring' => new DescriptorApplicationMbString()]
|
||||
));
|
||||
}
|
||||
|
||||
|
||||
@@ -26,57 +26,57 @@ class ObjectsProvider
|
||||
{
|
||||
public static function getInputArguments()
|
||||
{
|
||||
return array(
|
||||
return [
|
||||
'input_argument_1' => new InputArgument('argument_name', InputArgument::REQUIRED),
|
||||
'input_argument_2' => new InputArgument('argument_name', InputArgument::IS_ARRAY, 'argument description'),
|
||||
'input_argument_3' => new InputArgument('argument_name', InputArgument::OPTIONAL, 'argument description', 'default_value'),
|
||||
'input_argument_4' => new InputArgument('argument_name', InputArgument::REQUIRED, "multiline\nargument description"),
|
||||
'input_argument_with_style' => new InputArgument('argument_name', InputArgument::OPTIONAL, 'argument description', '<comment>style</>'),
|
||||
'input_argument_with_default_inf_value' => new InputArgument('argument_name', InputArgument::OPTIONAL, 'argument description', INF),
|
||||
);
|
||||
];
|
||||
}
|
||||
|
||||
public static function getInputOptions()
|
||||
{
|
||||
return array(
|
||||
return [
|
||||
'input_option_1' => new InputOption('option_name', 'o', InputOption::VALUE_NONE),
|
||||
'input_option_2' => new InputOption('option_name', 'o', InputOption::VALUE_OPTIONAL, 'option description', 'default_value'),
|
||||
'input_option_3' => new InputOption('option_name', 'o', InputOption::VALUE_REQUIRED, 'option description'),
|
||||
'input_option_4' => new InputOption('option_name', 'o', InputOption::VALUE_IS_ARRAY | InputOption::VALUE_OPTIONAL, 'option description', array()),
|
||||
'input_option_4' => new InputOption('option_name', 'o', InputOption::VALUE_IS_ARRAY | InputOption::VALUE_OPTIONAL, 'option description', []),
|
||||
'input_option_5' => new InputOption('option_name', 'o', InputOption::VALUE_REQUIRED, "multiline\noption description"),
|
||||
'input_option_6' => new InputOption('option_name', array('o', 'O'), InputOption::VALUE_REQUIRED, 'option with multiple shortcuts'),
|
||||
'input_option_6' => new InputOption('option_name', ['o', 'O'], InputOption::VALUE_REQUIRED, 'option with multiple shortcuts'),
|
||||
'input_option_with_style' => new InputOption('option_name', 'o', InputOption::VALUE_REQUIRED, 'option description', '<comment>style</>'),
|
||||
'input_option_with_style_array' => new InputOption('option_name', 'o', InputOption::VALUE_IS_ARRAY | InputOption::VALUE_REQUIRED, 'option description', array('<comment>Hello</comment>', '<info>world</info>')),
|
||||
'input_option_with_style_array' => new InputOption('option_name', 'o', InputOption::VALUE_IS_ARRAY | InputOption::VALUE_REQUIRED, 'option description', ['<comment>Hello</comment>', '<info>world</info>']),
|
||||
'input_option_with_default_inf_value' => new InputOption('option_name', 'o', InputOption::VALUE_OPTIONAL, 'option description', INF),
|
||||
);
|
||||
];
|
||||
}
|
||||
|
||||
public static function getInputDefinitions()
|
||||
{
|
||||
return array(
|
||||
return [
|
||||
'input_definition_1' => new InputDefinition(),
|
||||
'input_definition_2' => new InputDefinition(array(new InputArgument('argument_name', InputArgument::REQUIRED))),
|
||||
'input_definition_3' => new InputDefinition(array(new InputOption('option_name', 'o', InputOption::VALUE_NONE))),
|
||||
'input_definition_4' => new InputDefinition(array(
|
||||
'input_definition_2' => new InputDefinition([new InputArgument('argument_name', InputArgument::REQUIRED)]),
|
||||
'input_definition_3' => new InputDefinition([new InputOption('option_name', 'o', InputOption::VALUE_NONE)]),
|
||||
'input_definition_4' => new InputDefinition([
|
||||
new InputArgument('argument_name', InputArgument::REQUIRED),
|
||||
new InputOption('option_name', 'o', InputOption::VALUE_NONE),
|
||||
)),
|
||||
);
|
||||
]),
|
||||
];
|
||||
}
|
||||
|
||||
public static function getCommands()
|
||||
{
|
||||
return array(
|
||||
return [
|
||||
'command_1' => new DescriptorCommand1(),
|
||||
'command_2' => new DescriptorCommand2(),
|
||||
);
|
||||
];
|
||||
}
|
||||
|
||||
public static function getApplications()
|
||||
{
|
||||
return array(
|
||||
return [
|
||||
'application_1' => new DescriptorApplication1(),
|
||||
'application_2' => new DescriptorApplication2(),
|
||||
);
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -22,7 +22,7 @@ class TextDescriptorTest extends AbstractDescriptorTest
|
||||
{
|
||||
return $this->getDescriptionTestData(array_merge(
|
||||
ObjectsProvider::getCommands(),
|
||||
array('command_mbstring' => new DescriptorCommandMbString())
|
||||
['command_mbstring' => new DescriptorCommandMbString()]
|
||||
));
|
||||
}
|
||||
|
||||
@@ -30,7 +30,7 @@ class TextDescriptorTest extends AbstractDescriptorTest
|
||||
{
|
||||
return $this->getDescriptionTestData(array_merge(
|
||||
ObjectsProvider::getApplications(),
|
||||
array('application_mbstring' => new DescriptorApplicationMbString())
|
||||
['application_mbstring' => new DescriptorApplicationMbString()]
|
||||
));
|
||||
}
|
||||
|
||||
@@ -38,7 +38,7 @@ class TextDescriptorTest extends AbstractDescriptorTest
|
||||
{
|
||||
$application = new DescriptorApplication2();
|
||||
|
||||
$this->assertDescription(file_get_contents(__DIR__.'/../Fixtures/application_filtered_namespace.txt'), $application, array('namespace' => 'command4'));
|
||||
$this->assertDescription(file_get_contents(__DIR__.'/../Fixtures/application_filtered_namespace.txt'), $application, ['namespace' => 'command4']);
|
||||
}
|
||||
|
||||
protected function getDescriptor()
|
||||
|
||||
Reference in New Issue
Block a user