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()); } }