@@ 56-65 (lines=10) @@ | ||
53 | $this->shouldThrow($exc)->duringExecute(array(), $object, $method); |
|
54 | } |
|
55 | ||
56 | function it_throws_errors_by_class_name() |
|
57 | { |
|
58 | if (!class_exists('\Error')) { |
|
59 | throw new SkippingException('The class Error, introduced in PHP 7, does not exist'); |
|
60 | } |
|
61 | ||
62 | $this->beConstructedWith('\Error'); |
|
63 | ||
64 | $this->shouldNotThrow('Prophecy\Exception\InvalidArgumentException')->duringInstantiation(); |
|
65 | } |
|
66 | ||
67 | function it_does_not_throw_something_that_is_not_throwable_by_class_name() |
|
68 | { |
|
@@ 88-97 (lines=10) @@ | ||
85 | $this->shouldNotThrow('Prophecy\Exception\InvalidArgumentException')->duringInstantiation(); |
|
86 | } |
|
87 | ||
88 | function it_throws_an_extension_of_throwable_by_class_name() |
|
89 | { |
|
90 | if (!interface_exists('\Throwable')) { |
|
91 | throw new SkippingException('The interface Throwable, introduced in PHP 7, does not exist'); |
|
92 | } |
|
93 | ||
94 | $this->beConstructedWith('\Fixtures\Prophecy\ThrowableInterface'); |
|
95 | ||
96 | $this->shouldNotThrow('Prophecy\Exception\InvalidArgumentException')->duringInstantiation(); |
|
97 | } |
|
98 | ||
99 | function it_throws_a_throwable_by_class_name() |
|
100 | { |
|
@@ 99-108 (lines=10) @@ | ||
96 | $this->shouldNotThrow('Prophecy\Exception\InvalidArgumentException')->duringInstantiation(); |
|
97 | } |
|
98 | ||
99 | function it_throws_a_throwable_by_class_name() |
|
100 | { |
|
101 | if (!interface_exists('\Throwable')) { |
|
102 | throw new SkippingException('The interface Throwable, introduced in PHP 7, does not exist'); |
|
103 | } |
|
104 | ||
105 | $this->beConstructedWith('\Throwable'); |
|
106 | ||
107 | $this->shouldNotThrow('Prophecy\Exception\InvalidArgumentException')->duringInstantiation(); |
|
108 | } |
|
109 | } |
|
110 | ||
111 | class RequiredArgumentException extends \Exception |