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