| Total Complexity | 11 |
| Total Lines | 83 |
| Duplicated Lines | 0 % |
| Coverage | 100% |
| Changes | 1 | ||
| Bugs | 0 | Features | 1 |
| 1 | <?php declare(strict_types=1); |
||
| 8 | final class Expect |
||
| 9 | { |
||
| 10 | /** |
||
| 11 | * @var TestCase |
||
| 12 | */ |
||
| 13 | private $testCase; |
||
| 14 | |||
| 15 | /** |
||
| 16 | * Expect constructor. |
||
| 17 | * |
||
| 18 | * @param TestCase $testCase |
||
| 19 | */ |
||
| 20 | 10 | private function __construct(TestCase $testCase) |
|
| 21 | { |
||
| 22 | 10 | $this->testCase = $testCase; |
|
| 23 | 10 | } |
|
| 24 | |||
| 25 | 10 | public static function after(TestCase $testCase) |
|
| 28 | } |
||
| 29 | |||
| 30 | 6 | public function anException(string $class = \Exception::class): self |
|
| 31 | { |
||
| 32 | 6 | $this->testCase->expectException($class); |
|
| 33 | |||
| 34 | 6 | return $this; |
|
| 35 | } |
||
| 36 | |||
| 37 | 1 | public function describedBy(string $message): self |
|
| 38 | { |
||
| 39 | 1 | $this->testCase->expectExceptionMessage($message); |
|
| 40 | |||
| 41 | 1 | return $this; |
|
| 42 | } |
||
| 43 | |||
| 44 | 1 | public function havingCode(int $code): self |
|
| 45 | { |
||
| 46 | 1 | $this->testCase->expectExceptionCode($code); |
|
| 47 | |||
| 48 | 1 | return $this; |
|
| 49 | } |
||
| 50 | |||
| 51 | 1 | public function aDeprecation(): self |
|
| 52 | { |
||
| 53 | 1 | $this->testCase->expectDeprecation(); |
|
| 54 | |||
| 55 | 1 | return $this; |
|
| 56 | } |
||
| 57 | |||
| 58 | 1 | public function aNotice(): self |
|
| 59 | { |
||
| 60 | 1 | $this->testCase->expectNotice(); |
|
| 61 | |||
| 62 | 1 | return $this; |
|
| 63 | } |
||
| 64 | |||
| 65 | 1 | public function aWarning(): self |
|
| 66 | { |
||
| 67 | 1 | $this->testCase->expectWarning(); |
|
| 68 | |||
| 69 | 1 | return $this; |
|
| 70 | } |
||
| 71 | |||
| 72 | 1 | public function anError(): self |
|
| 77 | } |
||
| 78 | |||
| 79 | 1 | public function describedByAMessageMatching(string $pattern): self |
|
| 80 | { |
||
| 81 | 1 | $this->testCase->expectDeprecationMessageMatches($pattern); |
|
| 82 | |||
| 83 | 1 | return $this; |
|
| 84 | } |
||
| 85 | |||
| 86 | 1 | public function describedByAMessageContaining(string $part): self |
|
| 91 | } |
||
| 92 | } |
||
| 93 |