@@ 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\Doctrine\Mapping\Statement')) |
|
58 | ; |
|
59 | ||
60 | $mappedStatement = Statement::fromModel(StatementFixtures::getMinimalStatement()); |
|
61 | $this->repository->storeStatement($mappedStatement, true); |
|
62 | } |
|
63 | ||
64 | public function testFlushIsCalledByDefault() |
|
65 | { |
|
@@ 64-74 (lines=11) @@ | ||
61 | $this->repository->storeStatement($mappedStatement, true); |
|
62 | } |
|
63 | ||
64 | public function testFlushIsCalledByDefault() |
|
65 | { |
|
66 | $this |
|
67 | ->objectManager |
|
68 | ->expects($this->once()) |
|
69 | ->method('flush') |
|
70 | ; |
|
71 | ||
72 | $mappedStatement = Statement::fromModel(StatementFixtures::getMinimalStatement()); |
|
73 | $this->repository->storeStatement($mappedStatement); |
|
74 | } |
|
75 | ||
76 | public function testCallToFlushCanBeSuppressed() |
|
77 | { |
|
@@ 76-86 (lines=11) @@ | ||
73 | $this->repository->storeStatement($mappedStatement); |
|
74 | } |
|
75 | ||
76 | public function testCallToFlushCanBeSuppressed() |
|
77 | { |
|
78 | $this |
|
79 | ->objectManager |
|
80 | ->expects($this->never()) |
|
81 | ->method('flush') |
|
82 | ; |
|
83 | ||
84 | $mappedStatement = Statement::fromModel(StatementFixtures::getMinimalStatement()); |
|
85 | $this->repository->storeStatement($mappedStatement, false); |
|
86 | } |
|
87 | ||
88 | abstract protected function getObjectManagerClass(); |
|
89 |