| @@ 17-27 (lines=11) @@ | ||
| 14 | /** |
|
| 15 | * Method save SHOULD be called on the entiy repository |
|
| 16 | */ |
|
| 17 | public function testSave() |
|
| 18 | { |
|
| 19 | // repository save method SHOULD be called |
|
| 20 | $repositoryMock = $this->mockEntityRepository(); |
|
| 21 | $repositoryMock |
|
| 22 | ->expects($this->once()) |
|
| 23 | ->method('save'); |
|
| 24 | ||
| 25 | $dataProvider = new DataProvider($repositoryMock); |
|
| 26 | $dataProvider->save(new stdClass()); |
|
| 27 | } |
|
| 28 | ||
| 29 | /** |
|
| 30 | * Method delete SHOULD be called on the entity repository |
|
| @@ 32-42 (lines=11) @@ | ||
| 29 | /** |
|
| 30 | * Method delete SHOULD be called on the entity repository |
|
| 31 | */ |
|
| 32 | public function testDelete() |
|
| 33 | { |
|
| 34 | // entity manager delete method SHOULD be called |
|
| 35 | $repositoryMock = $this->mockEntityRepository(); |
|
| 36 | $repositoryMock |
|
| 37 | ->expects($this->once()) |
|
| 38 | ->method('delete'); |
|
| 39 | ||
| 40 | $dataProvider = new DataProvider($repositoryMock); |
|
| 41 | $dataProvider->remove(new stdClass()); |
|
| 42 | } |
|
| 43 | ||
| 44 | /** |
|
| 45 | * Method find SHOULD be called on the entity repository |
|
| @@ 47-57 (lines=11) @@ | ||
| 44 | /** |
|
| 45 | * Method find SHOULD be called on the entity repository |
|
| 46 | */ |
|
| 47 | public function testFind() |
|
| 48 | { |
|
| 49 | // repository find method SHOULD be called |
|
| 50 | $repositoryMock = $this->mockEntityRepository(); |
|
| 51 | $repositoryMock |
|
| 52 | ->expects($this->once()) |
|
| 53 | ->method('find'); |
|
| 54 | ||
| 55 | $dataProvider = new DataProvider($repositoryMock); |
|
| 56 | $dataProvider->find('unique_id'); |
|
| 57 | } |
|
| 58 | ||
| 59 | /** |
|
| 60 | * Method findBy SHOULD be called on the entity repository |
|
| @@ 62-72 (lines=11) @@ | ||
| 59 | /** |
|
| 60 | * Method findBy SHOULD be called on the entity repository |
|
| 61 | */ |
|
| 62 | public function testfindBy() |
|
| 63 | { |
|
| 64 | // repository findBy method SHOULD be called |
|
| 65 | $repositoryMock = $this->mockEntityRepository(); |
|
| 66 | $repositoryMock |
|
| 67 | ->expects($this->once()) |
|
| 68 | ->method('findBy'); |
|
| 69 | ||
| 70 | $dataProvider = new DataProvider($repositoryMock); |
|
| 71 | $dataProvider->findBy([]); |
|
| 72 | } |
|
| 73 | } |
|
| 74 | ||