Skip to content

Commit

Permalink
test: Simplify usage of realpath in DiffTest (#1051)
Browse files Browse the repository at this point in the history
  • Loading branch information
theofidry authored Oct 11, 2023
1 parent df55b9d commit 58e3a0a
Showing 1 changed file with 18 additions and 18 deletions.
36 changes: 18 additions & 18 deletions tests/Console/Command/DiffTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,8 @@ public function test_it_can_display_the_diff_of_two_phar_files(
$this->commandTester->execute(
[
'command' => 'diff',
'pharA' => $pharAPath,
'pharB' => $pharBPath,
'pharA' => realpath($pharAPath),
'pharB' => realpath($pharBPath),
'--diff' => $diffMode->value,
],
);
Expand Down Expand Up @@ -358,8 +358,8 @@ public static function diffPharsProvider(): iterable
private static function commonDiffPharsProvider(): iterable
{
yield 'same PHAR' => [
realpath(self::FIXTURES_DIR.'/simple-phar-foo.phar'),
realpath(self::FIXTURES_DIR.'/simple-phar-foo.phar'),
self::FIXTURES_DIR.'/simple-phar-foo.phar',
self::FIXTURES_DIR.'/simple-phar-foo.phar',
<<<'OUTPUT'
// Comparing the two archives... (do not check the signatures)
Expand All @@ -376,8 +376,8 @@ private static function commonDiffPharsProvider(): iterable
];

yield 'different data; same content' => [
realpath(self::FIXTURES_DIR.'/simple-phar-bar.phar'),
realpath(self::FIXTURES_DIR.'/simple-phar-bar-compressed.phar'),
self::FIXTURES_DIR.'/simple-phar-bar.phar',
self::FIXTURES_DIR.'/simple-phar-bar-compressed.phar',
<<<'OUTPUT'
// Comparing the two archives... (do not check the signatures)
Expand Down Expand Up @@ -413,8 +413,8 @@ private static function listDiffPharsProvider(): iterable
yield from self::commonDiffPharsProvider();

yield 'different files' => [
realpath(self::FIXTURES_DIR.'/simple-phar-foo.phar'),
realpath(self::FIXTURES_DIR.'/simple-phar-bar.phar'),
self::FIXTURES_DIR.'/simple-phar-foo.phar',
self::FIXTURES_DIR.'/simple-phar-bar.phar',
<<<'OUTPUT'
// Comparing the two archives... (do not check the signatures)
Expand All @@ -438,8 +438,8 @@ private static function listDiffPharsProvider(): iterable
];

yield 'same files different content' => [
realpath(self::FIXTURES_DIR.'/simple-phar-bar.phar'),
realpath(self::FIXTURES_DIR.'/simple-phar-baz.phar'),
self::FIXTURES_DIR.'/simple-phar-bar.phar',
self::FIXTURES_DIR.'/simple-phar-baz.phar',
<<<'OUTPUT'
// Comparing the two archives... (do not check the signatures)
Expand All @@ -461,8 +461,8 @@ public static function gitDiffPharsProvider(): iterable
yield from self::commonDiffPharsProvider();

yield 'different files' => [
realpath(self::FIXTURES_DIR.'/simple-phar-foo.phar'),
realpath(self::FIXTURES_DIR.'/simple-phar-bar.phar'),
self::FIXTURES_DIR.'/simple-phar-foo.phar',
self::FIXTURES_DIR.'/simple-phar-bar.phar',
<<<'OUTPUT'
// Comparing the two archives... (do not check the signatures)
Expand All @@ -481,8 +481,8 @@ public static function gitDiffPharsProvider(): iterable
];

yield 'same files different content' => [
realpath(self::FIXTURES_DIR.'/simple-phar-bar.phar'),
realpath(self::FIXTURES_DIR.'/simple-phar-baz.phar'),
self::FIXTURES_DIR.'/simple-phar-bar.phar',
self::FIXTURES_DIR.'/simple-phar-baz.phar',
<<<'OUTPUT'
// Comparing the two archives... (do not check the signatures)
Expand Down Expand Up @@ -511,8 +511,8 @@ public static function GNUDiffPharsProvider(): iterable
yield from self::commonDiffPharsProvider();

yield 'different files' => [
realpath(self::FIXTURES_DIR.'/simple-phar-foo.phar'),
realpath(self::FIXTURES_DIR.'/simple-phar-bar.phar'),
self::FIXTURES_DIR.'/simple-phar-foo.phar',
self::FIXTURES_DIR.'/simple-phar-bar.phar',
<<<'OUTPUT'
// Comparing the two archives... (do not check the signatures)
Expand All @@ -529,8 +529,8 @@ public static function GNUDiffPharsProvider(): iterable
];

yield 'same files different content' => [
realpath(self::FIXTURES_DIR.'/simple-phar-bar.phar'),
realpath(self::FIXTURES_DIR.'/simple-phar-baz.phar'),
self::FIXTURES_DIR.'/simple-phar-bar.phar',
self::FIXTURES_DIR.'/simple-phar-baz.phar',
Platform::isOSX()
? <<<'OUTPUT'
Expand Down

0 comments on commit 58e3a0a

Please sign in to comment.