Total Complexity | 4 |
Total Lines | 44 |
Duplicated Lines | 0 % |
Changes | 0 |
1 | <?php namespace Unit\Chekote\NounStore\Key; |
||
9 | class BuildTest extends KeyTestCase |
||
10 | { |
||
11 | public function setUp(): void |
||
12 | { |
||
13 | parent::setUp(); |
||
14 | |||
15 | /* @noinspection PhpUndefinedMethodInspection */ |
||
16 | Phake::when($this->key)->build(Phake::anyParameters())->thenCallParent(); |
||
17 | } |
||
18 | |||
19 | public function testNullIndexReturnsUnmodifiedKey(): void |
||
20 | { |
||
21 | $key = 'Thing'; |
||
22 | |||
23 | $this->assertEquals($key, $this->key->build($key, null)); |
||
24 | } |
||
25 | |||
26 | public function testNonNullIndexReturnsModifiedKey(): void |
||
27 | { |
||
28 | $key = 'Thing'; |
||
29 | $index = 18; |
||
30 | $nth = $index + 1; |
||
31 | |||
32 | /* @noinspection PhpUndefinedMethodInspection */ |
||
33 | Phake::expect($this->key, 1)->getOrdinal($nth)->thenReturn('th'); |
||
34 | |||
35 | $this->assertEquals('19th Thing', $this->key->build($key, $index)); |
||
36 | } |
||
37 | |||
38 | public function testInvalidArgumentExceptionBubblesUpFromGetOrdinal(): void |
||
53 | } |
||
54 | } |
||
55 |
This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.
This is most likely a typographical error or the method has been renamed.