Exception.php in Zircon Profile 8
Same filename in this branch
- 8 vendor/sebastian/global-state/src/Exception.php
- 8 vendor/sebastian/recursion-context/src/Exception.php
- 8 vendor/phpunit/phpunit/src/Exception.php
- 8 vendor/symfony/serializer/Exception/Exception.php
- 8 vendor/easyrdf/easyrdf/lib/EasyRdf/Exception.php
- 8 vendor/phpunit/phpunit/src/Framework/Exception.php
- 8 vendor/phpunit/phpunit/src/Runner/Exception.php
- 8 vendor/phpunit/php-code-coverage/src/CodeCoverage/Exception.php
- 8 vendor/masterminds/html5/src/HTML5/Exception.php
- 8 vendor/behat/mink/src/Exception/Exception.php
- 8 vendor/phpspec/prophecy/src/Prophecy/Exception/Exception.php
- 8 vendor/easyrdf/easyrdf/lib/EasyRdf/Parser/Exception.php
- 8 vendor/easyrdf/easyrdf/lib/EasyRdf/Http/Exception.php
- 8 vendor/phpunit/phpunit/src/Framework/Constraint/Exception.php
- 8 vendor/phpunit/phpunit-mock-objects/src/Framework/MockObject/Exception/Exception.php
- 8 vendor/phpunit/phpunit-mock-objects/src/Framework/MockObject/Stub/Exception.php
Same filename and directory in other branches
File
vendor/phpunit/phpunit/src/Framework/Constraint/Exception.phpView source
<?php
/*
* This file is part of PHPUnit.
*
* (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.
*/
/**
* @since Class available since Release 3.6.6
*/
class PHPUnit_Framework_Constraint_Exception extends PHPUnit_Framework_Constraint {
/**
* @var string
*/
protected $className;
/**
* @param string $className
*/
public function __construct($className) {
parent::__construct();
$this->className = $className;
}
/**
* Evaluates the constraint for parameter $other. Returns true if the
* constraint is met, false otherwise.
*
* @param mixed $other Value or object to evaluate.
* @return bool
*/
protected function matches($other) {
return $other instanceof $this->className;
}
/**
* Returns the description of the failure
*
* The beginning of failure messages is "Failed asserting that" in most
* cases. This method should return the second part of that sentence.
*
* @param mixed $other Evaluated value or object.
* @return string
*/
protected function failureDescription($other) {
if ($other !== null) {
$message = '';
if ($other instanceof Exception) {
$message = '. Message was: "' . $other
->getMessage() . '" at' . "\n" . $other
->getTraceAsString();
}
return sprintf('exception of type "%s" matches expected exception "%s"%s', get_class($other), $this->className, $message);
}
return sprintf('exception of type "%s" is thrown', $this->className);
}
/**
* Returns a string representation of the constraint.
*
* @return string
*/
public function toString() {
return sprintf('exception of type "%s"', $this->className);
}
}
Classes
Name | Description |
---|---|
PHPUnit_Framework_Constraint_Exception | @since Class available since Release 3.6.6 |