Subversion Repositories web.creative

Rev

Details | Last modification | View Log

Rev Author Line No. Line
1 mjordaan 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
 * Creates a synthetic failed assertion.
13
 */
14
class PHPUnit_Framework_SyntheticError extends PHPUnit_Framework_AssertionFailedError
15
{
16
    /**
17
     * The synthetic file.
18
     *
19
     * @var string
20
     */
21
    protected $syntheticFile = '';
22
 
23
    /**
24
     * The synthetic line number.
25
     *
26
     * @var int
27
     */
28
    protected $syntheticLine = 0;
29
 
30
    /**
31
     * The synthetic trace.
32
     *
33
     * @var array
34
     */
35
    protected $syntheticTrace = [];
36
 
37
    /**
38
     * Constructor.
39
     *
40
     * @param string $message
41
     * @param int    $code
42
     * @param string $file
43
     * @param int    $line
44
     * @param array  $trace
45
     */
46
    public function __construct($message, $code, $file, $line, $trace)
47
    {
48
        parent::__construct($message, $code);
49
 
50
        $this->syntheticFile  = $file;
51
        $this->syntheticLine  = $line;
52
        $this->syntheticTrace = $trace;
53
    }
54
 
55
    /**
56
     * @return string
57
     */
58
    public function getSyntheticFile()
59
    {
60
        return $this->syntheticFile;
61
    }
62
 
63
    /**
64
     * @return int
65
     */
66
    public function getSyntheticLine()
67
    {
68
        return $this->syntheticLine;
69
    }
70
 
71
    /**
72
     * @return array
73
     */
74
    public function getSyntheticTrace()
75
    {
76
        return $this->syntheticTrace;
77
    }
78
}