| @@ 44-56 (lines=13) @@ | ||
| 41 | * |
|
| 42 | * @covers \eZ\Publish\API\Repository\Repository::commit |
|
| 43 | */ |
|
| 44 | public function testCommit() |
|
| 45 | { |
|
| 46 | $mockedRepository = $this->getRepository(); |
|
| 47 | $persistenceHandlerMock = $this->getPersistenceMock(); |
|
| 48 | ||
| 49 | $persistenceHandlerMock->expects( |
|
| 50 | $this->once() |
|
| 51 | )->method( |
|
| 52 | 'commit' |
|
| 53 | ); |
|
| 54 | ||
| 55 | $mockedRepository->commit(); |
|
| 56 | } |
|
| 57 | ||
| 58 | /** |
|
| 59 | * Test for the commit() method. |
|
| @@ 64-78 (lines=15) @@ | ||
| 61 | * @covers \eZ\Publish\API\Repository\Repository::commit |
|
| 62 | * @expectedException \RuntimeException |
|
| 63 | */ |
|
| 64 | public function testCommitThrowsRuntimeException() |
|
| 65 | { |
|
| 66 | $mockedRepository = $this->getRepository(); |
|
| 67 | $persistenceHandlerMock = $this->getPersistenceMock(); |
|
| 68 | ||
| 69 | $persistenceHandlerMock->expects( |
|
| 70 | $this->once() |
|
| 71 | )->method( |
|
| 72 | 'commit' |
|
| 73 | )->will( |
|
| 74 | $this->throwException(new \Exception()) |
|
| 75 | ); |
|
| 76 | ||
| 77 | $mockedRepository->commit(); |
|
| 78 | } |
|
| 79 | ||
| 80 | /** |
|
| 81 | * Test for the rollback() method. |
|