Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
theofidry committed Oct 11, 2023
1 parent 0ceb49a commit 4ca78ca
Show file tree
Hide file tree
Showing 3 changed files with 45 additions and 45 deletions.
2 changes: 1 addition & 1 deletion src/Console/Command/Diff.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@
use Fidry\Console\ExitCode;
use Fidry\Console\Input\IO;
use KevinGH\Box\Console\PharInfoRenderer;
use KevinGH\Box\Phar\DiffMode;
use KevinGH\Box\Phar\PharDiff;
use KevinGH\Box\Phar\PharInfo;
use KevinGH\Box\Phar\DiffMode;
use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Output\BufferedOutput;
Expand Down
3 changes: 1 addition & 2 deletions src/Phar/PharDiff.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@

use KevinGH\Box\Console\Command\Extract;
use KevinGH\Box\Pharaoh\PharDiff as ParagoniePharDiff;
use KevinGH\Box\Phar\DiffMode;
use SplFileInfo;
use Symfony\Component\Finder\Finder;
use Symfony\Component\Process\Process;
Expand Down Expand Up @@ -82,7 +81,7 @@ private static function getModeCommand(DiffMode $mode): string
{
return match ($mode) {
DiffMode::GIT => 'git diff --no-index',
DiffMode::GNU => 'diff',
DiffMode::GNU => 'diff --exclude='.Extract::PHAR_META_PATH,
};
}

Expand Down
85 changes: 43 additions & 42 deletions tests/Console/Command/DiffTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ public function test_it_can_display_the_diff_of_two_phar_files(
int $expectedStatusCode,
): void {
if (DiffMode::GIT === $diffMode) {
$this->markTestSkipped('TODO');
self::markTestSkipped('TODO');
}

$this->commandTester->execute(
Expand Down Expand Up @@ -102,19 +102,19 @@ public function test_it_can_display_the_list_diff_of_two_phar_files(): void
);

$expectedOutput = <<<'OUTPUT'
// Comparing the two archives... (do not check the signatures)
[OK] The two archives are identical
// Comparing the two archives contents...
⚠️ <warning>Using the option "list-diff" is deprecated. Use "--diff=list" instead.</warning>
[OK] The contents are identical
OUTPUT;
// Comparing the two archives... (do not check the signatures)
[OK] The two archives are identical
// Comparing the two archives contents...
⚠️ <warning>Using the option "list-diff" is deprecated. Use "--diff=list" instead.</warning>
[OK] The contents are identical


OUTPUT;

$this->assertSameOutput(
$expectedOutput,
Expand All @@ -127,7 +127,7 @@ public function test_it_can_display_the_list_diff_of_two_phar_files(): void
*/
public function test_it_can_display_the_git_diff_of_two_phar_files(): void
{
$this->markTestSkipped('TODO');
self::markTestSkipped('TODO');
$pharPath = realpath(self::FIXTURES_DIR.'/simple-phar-foo.phar');

$this->commandTester->execute(
Expand All @@ -140,27 +140,28 @@ public function test_it_can_display_the_git_diff_of_two_phar_files(): void
);

$expectedOutput = <<<'OUTPUT'
// Comparing the two archives... (do not check the signatures)
[OK] The two archives are identical
// Comparing the two archives contents...
⚠️ <warning>Using the option "list-diff" is deprecated. Use "--diff=list" instead.</warning>
[OK] The contents are identical
OUTPUT;
// Comparing the two archives... (do not check the signatures)
[OK] The two archives are identical
// Comparing the two archives contents...
⚠️ <warning>Using the option "list-diff" is deprecated. Use "--diff=list" instead.</warning>
[OK] The contents are identical


OUTPUT;

$this->assertSameOutput(
$expectedOutput,
ExitCode::SUCCESS,
);
}

public function test_it_can_display_the_gnu_diff_of_two_phar_files(): void {
public function test_it_can_display_the_gnu_diff_of_two_phar_files(): void
{
$pharPath = realpath(self::FIXTURES_DIR.'/simple-phar-foo.phar');

$this->commandTester->execute(
Expand All @@ -173,19 +174,19 @@ public function test_it_can_display_the_gnu_diff_of_two_phar_files(): void {
);

$expectedOutput = <<<'OUTPUT'
// Comparing the two archives... (do not check the signatures)
[OK] The two archives are identical
// Comparing the two archives contents...
⚠️ <warning>Using the option "gnu-diff" is deprecated. Use "--diff=gnu" instead.</warning>
[OK] The contents are identical
OUTPUT;
// Comparing the two archives... (do not check the signatures)
[OK] The two archives are identical
// Comparing the two archives contents...
⚠️ <warning>Using the option "gnu-diff" is deprecated. Use "--diff=gnu" instead.</warning>
[OK] The contents are identical


OUTPUT;

$this->assertSameOutput(
$expectedOutput,
Expand Down

0 comments on commit 4ca78ca

Please sign in to comment.