mirror of
https://github.com/composer/composer
synced 2025-05-09 16:42:57 +00:00
Add test and documentation regarding audit command when no packages are required (#11092)
This commit is contained in:
parent
b52e6b4a74
commit
52f91b2dd9
2 changed files with 30 additions and 0 deletions
|
@ -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
|
||||
```
|
||||
|
|
28
tests/Composer/Test/Command/AuditCommandTest.php
Normal file
28
tests/Composer/Test/Command/AuditCommandTest.php
Normal 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();
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue