From 54ccdf7ad1cd63180e3ce32f3576fa6552c4f0a9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20Fr=C3=B6mer?= Date: Tue, 4 Jan 2022 18:22:05 +0100 Subject: [PATCH] Fix unit test MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Andreas Frömer --- tests/Integration/UnusedCommandTest.php | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/tests/Integration/UnusedCommandTest.php b/tests/Integration/UnusedCommandTest.php index 67f32215..22a00716 100644 --- a/tests/Integration/UnusedCommandTest.php +++ b/tests/Integration/UnusedCommandTest.php @@ -120,13 +120,10 @@ public function itShouldNotReportPatternExcludedPackages(): void public function itShouldNotReportFileDependencyWithFunctionGuard(): void { chdir(__DIR__ . '/../assets/TestProjects/FileDependencyFunctionWithGuard'); + $commandTester = new CommandTester($this->container->get(UnusedCommand::class)); + $exitCode = $commandTester->execute([]); - self::assertEquals( - 0, - $this->getApplication()->run( - new ArrayInput(['unused']), - new NullOutput() - ) - ); + self::assertSame(0, $exitCode); + self::assertStringContainsString('Found 1 used, 0 unused and 0 ignored packages', $commandTester->getDisplay()); } }