Add test and documentation regarding audit command when no packages are required (#11092)
parent
b52e6b4a74
commit
52f91b2dd9
|
@ -1043,6 +1043,8 @@ for possible security issues. It checks for and
|
|||
lists security vulnerability advisories according to the
|
||||
[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
|
||||
php composer.phar audit
|
||||
```
|
||||
|
|
|
@ -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();
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue