protected function cleanDatabase()
 {
     foreach ($this->repository->findStatements(array()) as $statement) {
         $this->objectManager->remove($statement);
     }
     $this->objectManager->flush();
 }
 public function testSaveWithoutFlush()
 {
     $statement = StatementFixtures::getMinimalStatement();
     $this->mappedStatementRepository->expects($this->once())->method('storeStatement')->with($this->callback(function (MappedStatement $mappedStatement) use($statement) {
         $expected = MappedStatement::fromModel($statement);
         $actual = clone $mappedStatement;
         $actual->stored = null;
         return $expected == $actual;
     }), false);
     $this->statementRepository->storeStatement($statement, false);
 }
 public function testCallToFlushCanBeSuppressed()
 {
     $this->objectManager->expects($this->never())->method('flush');
     $mappedStatement = Statement::fromModel(StatementFixtures::getMinimalStatement());
     $this->repository->storeStatement($mappedStatement, false);
 }