- PHP 7.3+
- PHPUnit 9+
To install through composer, simply put the following in your composer.json
file:
{
"require-dev": {
"vgirol/phpunit-exception": "dev-master"
}
}
And then run composer install
from the terminal.
Above installation can also be simplified by using the following command:
$ composer require vgirol/phpunit-exception
use PHPUnit\Framework\TestCase as BaseTestCase;
use VGirol\PhpunitException\SetExceptionsTrait;
class TestCase extends BaseTestCase
{
use SetExceptionsTrait;
public function test()
{
$className = \Exception::class;
$message = 'Error';
$code = 666;
$this->setFailure($className, $message, $code);
throw new \Exception($message, $code);
}
}
The API documentation is available in XHTML format at the url http://Phpunit-Exception.girol.fr/docs/ref/index.html.
Please see CHANGELOG for more information on what has changed recently.
composer test
Please see CONTRIBUTING and CODE_OF_CONDUCT for details.
If you discover any security related issues, please email vincent@girol.fr instead of using the issue tracker.
The MIT License (MIT). Please see License File for more information.