|
@@ 51-62 (lines=12) @@
|
| 48 |
|
$this->repository = $this->createMappedStatementRepository($this->objectManager, $this->unitOfWork, $this->classMetadata); |
| 49 |
|
} |
| 50 |
|
|
| 51 |
|
public function testStatementDocumentIsPersisted() |
| 52 |
|
{ |
| 53 |
|
$this |
| 54 |
|
->objectManager |
| 55 |
|
->expects($this->once()) |
| 56 |
|
->method('persist') |
| 57 |
|
->with($this->isInstanceOf('\XApi\Repository\Api\Mapping\MappedStatement')) |
| 58 |
|
; |
| 59 |
|
|
| 60 |
|
$mappedStatement = MappedStatement::createFromModel(StatementFixtures::getMinimalStatement()); |
| 61 |
|
$this->repository->storeMappedStatement($mappedStatement, true); |
| 62 |
|
} |
| 63 |
|
|
| 64 |
|
public function testFlushIsCalledByDefault() |
| 65 |
|
{ |
|
@@ 64-74 (lines=11) @@
|
| 61 |
|
$this->repository->storeMappedStatement($mappedStatement, true); |
| 62 |
|
} |
| 63 |
|
|
| 64 |
|
public function testFlushIsCalledByDefault() |
| 65 |
|
{ |
| 66 |
|
$this |
| 67 |
|
->objectManager |
| 68 |
|
->expects($this->once()) |
| 69 |
|
->method('flush') |
| 70 |
|
; |
| 71 |
|
|
| 72 |
|
$mappedStatement = MappedStatement::createFromModel(StatementFixtures::getMinimalStatement()); |
| 73 |
|
$this->repository->storeMappedStatement($mappedStatement); |
| 74 |
|
} |
| 75 |
|
|
| 76 |
|
public function testCallToFlushCanBeSuppressed() |
| 77 |
|
{ |
|
@@ 76-86 (lines=11) @@
|
| 73 |
|
$this->repository->storeMappedStatement($mappedStatement); |
| 74 |
|
} |
| 75 |
|
|
| 76 |
|
public function testCallToFlushCanBeSuppressed() |
| 77 |
|
{ |
| 78 |
|
$this |
| 79 |
|
->objectManager |
| 80 |
|
->expects($this->never()) |
| 81 |
|
->method('flush') |
| 82 |
|
; |
| 83 |
|
|
| 84 |
|
$mappedStatement = MappedStatement::createFromModel(StatementFixtures::getMinimalStatement()); |
| 85 |
|
$this->repository->storeMappedStatement($mappedStatement, false); |
| 86 |
|
} |
| 87 |
|
|
| 88 |
|
abstract protected function getObjectManagerClass(); |
| 89 |
|
|