1
0
Fork 0

Add test and documentation regarding audit command when no packages are required (#11092)

pull/11079/merge
Gaëtan Faugère 2022-10-13 10:53:26 +02:00 committed by GitHub
parent b52e6b4a74
commit 52f91b2dd9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 30 additions and 0 deletions

View File

@ -1043,6 +1043,8 @@ for possible security issues. It checks for and
lists security vulnerability advisories according to the lists security vulnerability advisories according to the
[Packagist.org api](https://packagist.org/apidoc#list-security-advisories). [Packagist.org api](https://packagist.org/apidoc#list-security-advisories).
The audit command returns the amount of vulnerabilities found. `0` if successful, and up to `255` otherwise.
```shell ```shell
php composer.phar audit php composer.phar audit
``` ```

View File

@ -0,0 +1,28 @@
<?php declare(strict_types=1);
/*
* This file is part of Composer.
*
* (c) Nils Adermann <naderman@naderman.de>
* Jordi Boggiano <j.boggiano@seld.be>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Composer\Test\Command;
use Composer\Test\TestCase;
class AuditCommandTest extends TestCase
{
public function testSuccessfulResponseCodeWhenNoPackagesAreRequired(): void
{
$this->initTempComposer();
$appTester = $this->getApplicationTester();
$appTester->run(['command' => 'audit']);
$appTester->assertCommandIsSuccessful();
}
}