Conditions | 1 |
Paths | 1 |
Total Lines | 20 |
Code Lines | 15 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
36 | public function testForKey() |
||
37 | { |
||
38 | $this |
||
39 | ->given($cause = new \Exception('some cause')) |
||
40 | ->when($exception = InvalidKeyException::forKey('foo', '', $cause)) |
||
41 | ->then |
||
42 | ->object($exception) |
||
43 | ->isInstanceOf(InvalidKeyException::class) |
||
44 | ->integer($exception->getCode()) |
||
45 | ->isEqualTo(0) |
||
46 | ->object($exception->getPrevious()) |
||
47 | ->isIdenticalTo($cause) |
||
48 | ; |
||
49 | |||
50 | $this |
||
51 | ->given($exception = InvalidKeyException::forKey('bar')) |
||
52 | ->then |
||
53 | ->variable($exception->getPrevious())->isNull() |
||
54 | ; |
||
55 | } |
||
56 | } |
||
57 |