Version 1
[yaffs-website] / vendor / phpunit / phpunit / src / Framework / ExpectationFailedException.php
1 <?php
2 /*
3  * This file is part of PHPUnit.
4  *
5  * (c) Sebastian Bergmann <sebastian@phpunit.de>
6  *
7  * For the full copyright and license information, please view the LICENSE
8  * file that was distributed with this source code.
9  */
10
11 /**
12  * Exception for expectations which failed their check.
13  *
14  * The exception contains the error message and optionally a
15  * SebastianBergmann\Comparator\ComparisonFailure which is used to
16  * generate diff output of the failed expectations.
17  *
18  * @since Class available since Release 3.0.0
19  */
20 class PHPUnit_Framework_ExpectationFailedException extends PHPUnit_Framework_AssertionFailedError
21 {
22     /**
23      * @var SebastianBergmann\Comparator\ComparisonFailure
24      */
25     protected $comparisonFailure;
26
27     public function __construct($message, SebastianBergmann\Comparator\ComparisonFailure $comparisonFailure = null, Exception $previous = null)
28     {
29         $this->comparisonFailure = $comparisonFailure;
30
31         parent::__construct($message, 0, $previous);
32     }
33
34     /**
35      * @return SebastianBergmann\Comparator\ComparisonFailure
36      */
37     public function getComparisonFailure()
38     {
39         return $this->comparisonFailure;
40     }
41 }