| @@ 87-99 (lines=13) @@ | ||
| 84 | $this->assertEquals($expected[2], $actual[2]); |
|
| 85 | } |
|
| 86 | ||
| 87 | public function testFind() { |
|
| 88 | $accountId = 123; |
|
| 89 | ||
| 90 | $this->mapper->expects($this->once()) |
|
| 91 | ->method('find') |
|
| 92 | ->with($this->user, $accountId) |
|
| 93 | ->will($this->returnValue($this->account1)); |
|
| 94 | ||
| 95 | $expected = new Account($this->account1); |
|
| 96 | $actual = $this->service->find($this->user, $accountId); |
|
| 97 | ||
| 98 | $this->assertEquals($expected, $actual); |
|
| 99 | } |
|
| 100 | ||
| 101 | public function testFindNotFound() { |
|
| 102 | // TODO: implement code + write tests |
|
| @@ 48-63 (lines=16) @@ | ||
| 45 | ->getMock(); |
|
| 46 | } |
|
| 47 | ||
| 48 | public function testFindAll() { |
|
| 49 | $accountId = 123; |
|
| 50 | ||
| 51 | $this->mapper->expects($this->once()) |
|
| 52 | ->method('findAll') |
|
| 53 | ->with($accountId, $this->user) |
|
| 54 | ->will($this->returnValue([$this->alias1])); |
|
| 55 | ||
| 56 | $expected = [ |
|
| 57 | new Alias($this->alias1) |
|
| 58 | ]; |
|
| 59 | $actual = $this->service->findAll($accountId, $this->user); |
|
| 60 | ||
| 61 | $this->assertEquals($expected, $actual); |
|
| 62 | ||
| 63 | } |
|
| 64 | ||
| 65 | public function testFind() { |
|
| 66 | $aliasId = 1; |
|
| @@ 65-78 (lines=14) @@ | ||
| 62 | ||
| 63 | } |
|
| 64 | ||
| 65 | public function testFind() { |
|
| 66 | $aliasId = 1; |
|
| 67 | ||
| 68 | $this->mapper->expects($this->once()) |
|
| 69 | ->method('find') |
|
| 70 | ->with($aliasId, $this->user) |
|
| 71 | ->will($this->returnValue($this->alias1)); |
|
| 72 | ||
| 73 | $expected = new Alias($this->alias1); |
|
| 74 | $actual = $this->service->find($aliasId, $this->user); |
|
| 75 | ||
| 76 | $this->assertEquals($expected, $actual); |
|
| 77 | ||
| 78 | } |
|
| 79 | ||
| 80 | public function testCreate() { |
|
| 81 | $accountId = 123; |
|