Total Complexity | 3 |
Total Lines | 32 |
Duplicated Lines | 0 % |
Changes | 0 |
1 | <?php |
||
11 | class RepositoryTest extends TestCase |
||
12 | { |
||
13 | /** |
||
14 | * @var RepositoryInterface |
||
15 | */ |
||
16 | private $repository; |
||
17 | |||
18 | public function testFindById() |
||
19 | { |
||
20 | $id = 1; |
||
21 | $model = $this->getMockForAbstractClass(AbstractModel::class); |
||
22 | $this->repository->expects($this->once()) |
||
|
|||
23 | ->method('findWhere') |
||
24 | ->with($this->equalTo(['id' => $id])) |
||
25 | ->willReturn(new Collection([$model])); |
||
26 | $this->assertSame($model, $this->repository->findById($id)); |
||
27 | } |
||
28 | |||
29 | public function testFind() |
||
30 | { |
||
31 | $id = 1; |
||
32 | $model = $this->getMockForAbstractClass(AbstractModel::class); |
||
33 | $this->repository->expects($this->any()) |
||
34 | ->method('findWhere') |
||
35 | ->with($this->equalTo(['id' => $id])) |
||
36 | ->willReturn(new Collection([$model])); |
||
37 | $this->assertSame($this->repository->find($id), $this->repository->findById($id)); |
||
38 | } |
||
39 | |||
40 | protected function setUp() |
||
43 | } |
||
44 | } |
||
45 |
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.