| @@ 319-326 (lines=8) @@ | ||
| 316 | return $locationServiceMock; |
|
| 317 | } |
|
| 318 | ||
| 319 | private function assertTransactionIsNotStarted(callable $operation): void |
|
| 320 | { |
|
| 321 | $repository = $this->getRepositoryMock(); |
|
| 322 | $repository->expects($this->never())->method('beginTransaction'); |
|
| 323 | $operation(); |
|
| 324 | $repository->expects($this->never())->method('commit'); |
|
| 325 | $repository->expects($this->never())->method('rollback'); |
|
| 326 | } |
|
| 327 | ||
| 328 | private function assertTransactionIsCommitted(callable $operation): void |
|
| 329 | { |
|
| @@ 328-335 (lines=8) @@ | ||
| 325 | $repository->expects($this->never())->method('rollback'); |
|
| 326 | } |
|
| 327 | ||
| 328 | private function assertTransactionIsCommitted(callable $operation): void |
|
| 329 | { |
|
| 330 | $repository = $this->getRepositoryMock(); |
|
| 331 | $repository->expects($this->once())->method('beginTransaction'); |
|
| 332 | $operation(); |
|
| 333 | $repository->expects($this->once())->method('commit'); |
|
| 334 | $repository->expects($this->never())->method('rollback'); |
|
| 335 | } |
|
| 336 | ||
| 337 | private function assertTransactionIsRollback(callable $operation): void |
|
| 338 | { |
|
| @@ 337-344 (lines=8) @@ | ||
| 334 | $repository->expects($this->never())->method('rollback'); |
|
| 335 | } |
|
| 336 | ||
| 337 | private function assertTransactionIsRollback(callable $operation): void |
|
| 338 | { |
|
| 339 | $repository = $this->getRepositoryMock(); |
|
| 340 | $repository->expects($this->once())->method('beginTransaction'); |
|
| 341 | $operation(); |
|
| 342 | $repository->expects($this->never())->method('commit'); |
|
| 343 | $repository->expects($this->once())->method('rollback'); |
|
| 344 | } |
|
| 345 | ||
| 346 | private function createLocation(int $id = self::CURRENT_USER_ID, string $name = 'Lorem ipsum...'): Location |
|
| 347 | { |
|
| @@ 204-211 (lines=8) @@ | ||
| 201 | ->getMock(); |
|
| 202 | } |
|
| 203 | ||
| 204 | private function assertTransactionIsCommitted(callable $operation): void |
|
| 205 | { |
|
| 206 | $repository = $this->getRepositoryMock(); |
|
| 207 | $repository->expects($this->once())->method('beginTransaction'); |
|
| 208 | $operation(); |
|
| 209 | $repository->expects($this->once())->method('commit'); |
|
| 210 | $repository->expects($this->never())->method('rollback'); |
|
| 211 | } |
|
| 212 | ||
| 213 | private function assertTransactionIsNotStarted(callable $operation): void |
|
| 214 | { |
|
| @@ 213-220 (lines=8) @@ | ||
| 210 | $repository->expects($this->never())->method('rollback'); |
|
| 211 | } |
|
| 212 | ||
| 213 | private function assertTransactionIsNotStarted(callable $operation): void |
|
| 214 | { |
|
| 215 | $repository = $this->getRepositoryMock(); |
|
| 216 | $repository->expects($this->never())->method('beginTransaction'); |
|
| 217 | $operation(); |
|
| 218 | $repository->expects($this->never())->method('commit'); |
|
| 219 | $repository->expects($this->never())->method('rollback'); |
|
| 220 | } |
|
| 221 | ||
| 222 | private function assertTransactionIsRollback(callable $operation): void |
|
| 223 | { |
|
| @@ 222-229 (lines=8) @@ | ||
| 219 | $repository->expects($this->never())->method('rollback'); |
|
| 220 | } |
|
| 221 | ||
| 222 | private function assertTransactionIsRollback(callable $operation): void |
|
| 223 | { |
|
| 224 | $repository = $this->getRepositoryMock(); |
|
| 225 | $repository->expects($this->once())->method('beginTransaction'); |
|
| 226 | $operation(); |
|
| 227 | $repository->expects($this->never())->method('commit'); |
|
| 228 | $repository->expects($this->once())->method('rollback'); |
|
| 229 | } |
|
| 230 | ||
| 231 | private function createAPIUserPreference(): APIUserPreference |
|
| 232 | { |
|