protected function cleanDatabase()
 {
     foreach ($this->repository->findMappedStatements(array()) as $statement) {
         $this->objectManager->remove($statement);
     }
     $this->objectManager->flush();
 }
 public function testSaveWithoutFlush()
 {
     $statement = StatementFixtures::getMinimalStatement();
     $self = $this;
     $this->mappedStatementRepository->expects($this->once())->method('storeMappedStatement')->with($this->callback(function (MappedStatement $mappedStatement) use($self, $statement) {
         return $self->assertMappedStatement(MappedStatement::createFromModel($statement), $mappedStatement);
     }), false);
     $this->statementRepository->storeStatement($statement, false);
 }
 public function testCallToFlushCanBeSuppressed()
 {
     $this->objectManager->expects($this->never())->method('flush');
     $mappedStatement = MappedStatement::createFromModel(StatementFixtures::getMinimalStatement());
     $this->repository->storeMappedStatement($mappedStatement, false);
 }