Skip to content

Instantly share code, notes, and snippets.

@tomasnorre
Created April 20, 2015 05:36
Show Gist options
  • Save tomasnorre/46c9fdb44f2a6cfee002 to your computer and use it in GitHub Desktop.
Save tomasnorre/46c9fdb44f2a6cfee002 to your computer and use it in GitHub Desktop.
....
public function tearDown() {
if (!$this->persistenceManager instanceof \TYPO3\Flow\Persistence\PersistenceManagerInterface){
$this->persistenceManager = $this->objectManager->get('TYPO3\Flow\Persistence\PersistenceManagerInterface');
};
if (!$this->playerRepository instanceof \TomasNorre\GolfnetInvitational\Domain\Repository\PlayerRepository){
$this->playerRepository = $this->objectManager->get('TomasNorre\GolfnetInvitational\Domain\Repository\PlayerRepository');
};
$this->playerRepository->removeAll();
$this->persistenceManager->persistAll();
unset($this->playerRepository);
unset($this->persistenceManager);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment