Exception.php in Zircon Profile 8.0
Same filename in this branch
- 8.0 vendor/sebastian/global-state/src/Exception.php
- 8.0 vendor/sebastian/recursion-context/src/Exception.php
- 8.0 vendor/phpunit/phpunit/src/Exception.php
- 8.0 vendor/symfony/serializer/Exception/Exception.php
- 8.0 vendor/easyrdf/easyrdf/lib/EasyRdf/Exception.php
- 8.0 vendor/phpunit/phpunit/src/Framework/Exception.php
- 8.0 vendor/phpunit/phpunit/src/Runner/Exception.php
- 8.0 vendor/phpunit/php-code-coverage/src/CodeCoverage/Exception.php
- 8.0 vendor/masterminds/html5/src/HTML5/Exception.php
- 8.0 vendor/behat/mink/src/Exception/Exception.php
- 8.0 vendor/phpspec/prophecy/src/Prophecy/Exception/Exception.php
- 8.0 vendor/easyrdf/easyrdf/lib/EasyRdf/Parser/Exception.php
- 8.0 vendor/easyrdf/easyrdf/lib/EasyRdf/Http/Exception.php
- 8.0 vendor/phpunit/phpunit/src/Framework/Constraint/Exception.php
- 8.0 vendor/phpunit/phpunit-mock-objects/src/Framework/MockObject/Exception/Exception.php
- 8.0 vendor/phpunit/phpunit-mock-objects/src/Framework/MockObject/Stub/Exception.php
Same filename and directory in other branches
File
vendor/phpunit/phpunit-mock-objects/src/Framework/MockObject/Stub/Exception.phpView source
<?php
/*
* This file is part of the PHPUnit_MockObject package.
*
* (c) Sebastian Bergmann <sebastian@phpunit.de>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
use SebastianBergmann\Exporter\Exporter;
/**
* Stubs a method by raising a user-defined exception.
*
* @since Class available since Release 1.0.0
*/
class PHPUnit_Framework_MockObject_Stub_Exception implements PHPUnit_Framework_MockObject_Stub {
protected $exception;
public function __construct(Exception $exception) {
$this->exception = $exception;
}
public function invoke(PHPUnit_Framework_MockObject_Invocation $invocation) {
throw $this->exception;
}
public function toString() {
$exporter = new Exporter();
return sprintf('raise user-specified exception %s', $exporter
->export($this->exception));
}
}
Classes
Name | Description |
---|---|
PHPUnit_Framework_MockObject_Stub_Exception | Stubs a method by raising a user-defined exception. |