From 338bc16a115d866b108b38399562b06c988cd93f Mon Sep 17 00:00:00 2001 From: theoboldalex <44616505+theoboldalex@users.noreply.github.com> Date: Wed, 7 Feb 2024 10:40:29 +0000 Subject: [PATCH] test: Covers audit of pkg with no sec advisories (#11789) --- 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 53041f33d..6bf751fab 100644 --- a/tests/Composer/Test/Command/AuditCommandTest.php +++ b/tests/Composer/Test/Command/AuditCommandTest.php @@ -41,4 +41,20 @@ class AuditCommandTest extends TestCase $appTester = $this->getApplicationTester(); $appTester->run(['command' => 'audit', '--locked' => true]); } + + public function testAuditPackageWithNoSecurityVulnerabilities(): void + { + $this->initTempComposer(); + $packages = [self::getPackage()]; + $this->createInstalledJson($packages); + $this->createComposerLock($packages); + + $appTester = $this->getApplicationTester(); + $appTester->run(['command' => 'audit', '--locked' => true]); + + self::assertStringContainsString( + 'No security vulnerability advisories found.', + trim($appTester->getDisplay(true)) + ); + } }