| @@ 70-89 (lines=20) @@ | ||
| 67 | $this->statementRepository->findStatementsBy($filter); |
|
| 68 | } |
|
| 69 | ||
| 70 | public function testSave() |
|
| 71 | { |
|
| 72 | $statement = StatementFixtures::getMinimalStatement(); |
|
| 73 | $self = $this; |
|
| 74 | $this |
|
| 75 | ->mappedStatementRepository |
|
| 76 | ->expects($this->once()) |
|
| 77 | ->method('storeMappedStatement') |
|
| 78 | ->with( |
|
| 79 | $this->callback(function (MappedStatement $mappedStatement) use ($self, $statement) { |
|
| 80 | return $self->assertMappedStatement( |
|
| 81 | MappedStatement::createFromModel($statement), |
|
| 82 | $mappedStatement |
|
| 83 | ); |
|
| 84 | }), |
|
| 85 | true |
|
| 86 | ); |
|
| 87 | ||
| 88 | $this->statementRepository->storeStatement($statement); |
|
| 89 | } |
|
| 90 | ||
| 91 | public function testSaveWithoutFlush() |
|
| 92 | { |
|
| @@ 91-110 (lines=20) @@ | ||
| 88 | $this->statementRepository->storeStatement($statement); |
|
| 89 | } |
|
| 90 | ||
| 91 | public function testSaveWithoutFlush() |
|
| 92 | { |
|
| 93 | $statement = StatementFixtures::getMinimalStatement(); |
|
| 94 | $self = $this; |
|
| 95 | $this |
|
| 96 | ->mappedStatementRepository |
|
| 97 | ->expects($this->once()) |
|
| 98 | ->method('storeMappedStatement') |
|
| 99 | ->with( |
|
| 100 | $this->callback(function (MappedStatement $mappedStatement) use ($self, $statement) { |
|
| 101 | return $self->assertMappedStatement( |
|
| 102 | MappedStatement::createFromModel($statement), |
|
| 103 | $mappedStatement |
|
| 104 | ); |
|
| 105 | }), |
|
| 106 | false |
|
| 107 | ); |
|
| 108 | ||
| 109 | $this->statementRepository->storeStatement($statement, false); |
|
| 110 | } |
|
| 111 | ||
| 112 | /** |
|
| 113 | * @return \PHPUnit_Framework_MockObject_MockObject|\XApi\Repository\Doctrine\Repository\MappedStatementRepository |
|