Skip to content

Fixed the tests on PHP 5.3.3 #8032

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 15, 2013
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -21,31 +21,31 @@
abstract class AbstractDescriptorTest extends \PHPUnit_Framework_TestCase
{
/** @dataProvider getDescribeInputArgumentTestData */
public function testDescribeInputArgument(DescriptorInterface $descriptor, InputArgument $argument, $expectedDescription)
public function testDescribeInputArgument(InputArgument $argument, $expectedDescription)
{
$this->assertEquals(trim($expectedDescription), trim($descriptor->describe($argument)));
$this->assertEquals(trim($expectedDescription), trim($this->getDescriptor()->describe($argument)));
}

/** @dataProvider getDescribeInputOptionTestData */
public function testDescribeInputOption(DescriptorInterface $descriptor, InputOption $option, $expectedDescription)
public function testDescribeInputOption(InputOption $option, $expectedDescription)
{
$this->assertEquals(trim($expectedDescription), trim($descriptor->describe($option)));
$this->assertEquals(trim($expectedDescription), trim($this->getDescriptor()->describe($option)));
}

/** @dataProvider getDescribeInputDefinitionTestData */
public function testDescribeInputDefinition(DescriptorInterface $descriptor, InputDefinition $definition, $expectedDescription)
public function testDescribeInputDefinition(InputDefinition $definition, $expectedDescription)
{
$this->assertEquals(trim($expectedDescription), trim($descriptor->describe($definition)));
$this->assertEquals(trim($expectedDescription), trim($this->getDescriptor()->describe($definition)));
}

/** @dataProvider getDescribeCommandTestData */
public function testDescribeCommand(DescriptorInterface $descriptor, Command $command, $expectedDescription)
public function testDescribeCommand(Command $command, $expectedDescription)
{
$this->assertEquals(trim($expectedDescription), trim($descriptor->describe($command)));
$this->assertEquals(trim($expectedDescription), trim($this->getDescriptor()->describe($command)));
}

/** @dataProvider getDescribeApplicationTestData */
public function testDescribeApplication(DescriptorInterface $descriptor, Application $application, $expectedDescription)
public function testDescribeApplication(Application $application, $expectedDescription)
{
// Replaces the dynamic placeholders of the command help text with a static version.
// The placeholder %command.full_name% includes the script path that is not predictable
Expand All @@ -54,7 +54,7 @@ public function testDescribeApplication(DescriptorInterface $descriptor, Applica
$command->setHelp(str_replace('%command.full_name%', 'app/console %command.name%', $command->getHelp()));
}

$this->assertEquals(trim($expectedDescription), trim(str_replace(PHP_EOL, "\n", $descriptor->describe($application))));
$this->assertEquals(trim($expectedDescription), trim(str_replace(PHP_EOL, "\n", $this->getDescriptor()->describe($application))));
}

public function getDescribeInputArgumentTestData()
Expand Down Expand Up @@ -90,7 +90,7 @@ private function getDescriptionTestData(array $objects)
$data = array();
foreach ($objects as $name => $object) {
$description = file_get_contents(sprintf('%s/../Fixtures/%s.%s', __DIR__, $name, $this->getFormat()));
$data[] = array($this->getDescriptor(), $object, $description);
$data[] = array($object, $description);
}

return $data;
Expand Down