| @@ 1098-1110 (lines=13) @@ | ||
| 1095 | * |
|
| 1096 | * @covers \eZ\Publish\API\Repository\Repository::commit |
|
| 1097 | */ |
|
| 1098 | public function testCommit() |
|
| 1099 | { |
|
| 1100 | $mockedRepository = $this->getRepository(); |
|
| 1101 | $persistenceHandlerMock = $this->getPersistenceMock(); |
|
| 1102 | ||
| 1103 | $persistenceHandlerMock->expects( |
|
| 1104 | $this->once() |
|
| 1105 | )->method( |
|
| 1106 | 'commit' |
|
| 1107 | ); |
|
| 1108 | ||
| 1109 | $mockedRepository->commit(); |
|
| 1110 | } |
|
| 1111 | ||
| 1112 | /** |
|
| 1113 | * Test for the commit() method. |
|
| @@ 1118-1132 (lines=15) @@ | ||
| 1115 | * @covers \eZ\Publish\API\Repository\Repository::commit |
|
| 1116 | * @expectedException \RuntimeException |
|
| 1117 | */ |
|
| 1118 | public function testCommitThrowsRuntimeException() |
|
| 1119 | { |
|
| 1120 | $mockedRepository = $this->getRepository(); |
|
| 1121 | $persistenceHandlerMock = $this->getPersistenceMock(); |
|
| 1122 | ||
| 1123 | $persistenceHandlerMock->expects( |
|
| 1124 | $this->once() |
|
| 1125 | )->method( |
|
| 1126 | 'commit' |
|
| 1127 | )->will( |
|
| 1128 | $this->throwException(new \Exception()) |
|
| 1129 | ); |
|
| 1130 | ||
| 1131 | $mockedRepository->commit(); |
|
| 1132 | } |
|
| 1133 | ||
| 1134 | /** |
|
| 1135 | * Test for the rollback() method. |
|