| @@ 112-127 (lines=16) @@ | ||
| 109 | * @expectedException \RuntimeException |
|
| 110 | * @expectedExceptionMessage test |
|
| 111 | */ |
|
| 112 | public function testCommitException() |
|
| 113 | { |
|
| 114 | $handler = $this->getTransactionHandler(); |
|
| 115 | $this->getDatabaseHandlerMock() |
|
| 116 | ->expects($this->once()) |
|
| 117 | ->method('commit') |
|
| 118 | ->will($this->throwException(new Exception('test'))); |
|
| 119 | $this->getContentTypeHandlerMock() |
|
| 120 | ->expects($this->never()) |
|
| 121 | ->method($this->anything()); |
|
| 122 | $this->getLanguageHandlerMock() |
|
| 123 | ->expects($this->never()) |
|
| 124 | ->method($this->anything()); |
|
| 125 | ||
| 126 | $handler->commit(); |
|
| 127 | } |
|
| 128 | ||
| 129 | /** |
|
| 130 | * @covers \eZ\Publish\Core\Persistence\Legacy\TransactionHandler::rollback |
|
| @@ 154-169 (lines=16) @@ | ||
| 151 | * @expectedException \RuntimeException |
|
| 152 | * @expectedExceptionMessage test |
|
| 153 | */ |
|
| 154 | public function testRollbackException() |
|
| 155 | { |
|
| 156 | $handler = $this->getTransactionHandler(); |
|
| 157 | $this->getDatabaseHandlerMock() |
|
| 158 | ->expects($this->once()) |
|
| 159 | ->method('rollback') |
|
| 160 | ->will($this->throwException(new Exception('test'))); |
|
| 161 | $this->getContentTypeHandlerMock() |
|
| 162 | ->expects($this->never()) |
|
| 163 | ->method($this->anything()); |
|
| 164 | $this->getLanguageHandlerMock() |
|
| 165 | ->expects($this->never()) |
|
| 166 | ->method($this->anything()); |
|
| 167 | ||
| 168 | $handler->rollback(); |
|
| 169 | } |
|
| 170 | ||
| 171 | /** |
|
| 172 | * Returns a mock object for the Content Gateway. |
|