From 7a6bb18e21b97330cbd69666afa9ac136a0373e9 Mon Sep 17 00:00:00 2001 From: theoboldalex <44616505+theoboldalex@users.noreply.github.com> Date: Thu, 8 Feb 2024 10:06:34 +0000 Subject: [PATCH] Adds a test for no dev (#11833) --- tests/Composer/Test/Command/AuditCommandTest.php | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/tests/Composer/Test/Command/AuditCommandTest.php b/tests/Composer/Test/Command/AuditCommandTest.php index 6bf751fab..4563e0fff 100644 --- a/tests/Composer/Test/Command/AuditCommandTest.php +++ b/tests/Composer/Test/Command/AuditCommandTest.php @@ -57,4 +57,20 @@ class AuditCommandTest extends TestCase trim($appTester->getDisplay(true)) ); } + + public function testAuditPackageWithNoDevOptionPassed(): void + { + $this->initTempComposer(); + $devPackage = [self::getPackage()]; + $this->createInstalledJson([], $devPackage); + $this->createComposerLock([], $devPackage); + + $appTester = $this->getApplicationTester(); + $appTester->run(['command' => 'audit', '--no-dev' => true]); + + self::assertStringContainsString( + 'No packages - skipping audit.', + trim($appTester->getDisplay(true)) + ); + } }