Skip to content

Commit

Permalink
test: Covers audit of pkg with no sec advisories
Browse files Browse the repository at this point in the history
  • Loading branch information
theoboldalex committed Jan 12, 2024
1 parent 75fd2bb commit bf500cc
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions tests/Composer/Test/Command/AuditCommandTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,4 +41,20 @@ public function testErrorAuditingLockFileWhenItIsMissing(): void
$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))
);
}
}

0 comments on commit bf500cc

Please sign in to comment.