From c13c88c3d0e98cb51497ce0ba382cc3bcacc5229 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Th=C3=A9o=20FIDRY?= Date: Mon, 9 Oct 2023 07:22:19 +0200 Subject: [PATCH] fix --- tests/Console/Command/DiffTest.php | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/tests/Console/Command/DiffTest.php b/tests/Console/Command/DiffTest.php index 9eb3f6c97..da2ce50ca 100644 --- a/tests/Console/Command/DiffTest.php +++ b/tests/Console/Command/DiffTest.php @@ -204,6 +204,9 @@ public function test_it_cannot_compare_non_existent_files(): void public function test_it_cannot_compare_a_non_phar_files(): void { + $this->expectException(InvalidPhar::class); + $this->expectExceptionMessageMatches('/^Could not create a Phar or PharData instance for the file.+not\-a\-phar\.phar.+$/'); + $this->commandTester->execute( [ 'command' => 'diff', @@ -211,11 +214,6 @@ public function test_it_cannot_compare_a_non_phar_files(): void 'pharB' => realpath(self::FIXTURES_DIR.'/not-a-phar.phar'), ], ); - - $expected = '/^Could not check the PHARs: Could not create a Phar or PharData instance for the file .+$/'; - - self::assertMatchesRegularExpression($expected, $this->commandTester->getDisplay(true)); - self::assertSame(1, $this->commandTester->getStatusCode()); } public function test_it_can_compare_phar_files_without_the_phar_extension(): void