Skip to content
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

test: Simplify usage of realpath in DiffTest #1051

Merged
merged 2 commits into from
Oct 11, 2023
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
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
Loading