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 */
18class PHPUnit_Framework_ExpectationFailedException extends PHPUnit_Framework_AssertionFailedError
19{
20    /**
21     * @var SebastianBergmann\Comparator\ComparisonFailure
22     */
23    protected $comparisonFailure;
24
25    public function __construct($message, SebastianBergmann\Comparator\ComparisonFailure $comparisonFailure = null, Exception $previous = null)
26    {
27        $this->comparisonFailure = $comparisonFailure;
28
29        parent::__construct($message, 0, $previous);
30    }
31
32    /**
33     * @return SebastianBergmann\Comparator\ComparisonFailure
34     */
35    public function getComparisonFailure()
36    {
37        return $this->comparisonFailure;
38    }
39}
40