/** * @test */ public function testCleanSnapshots() { /* $mockQuery = $this->getMock('TYPO3\Flow\Persistence\QueryResultInterface'); $mockQuery->expects($this->once())->method('count')->will($this->returnValue(0)); $mockRepository = $this->getMock('_OurBrand_\Quiz\Domain\Repository\QuizSessionRepository'); $mockRepository->expects($this->once())->method('findByQuiz')->with($this->anything())->will($this->returnValue($mockQuery)); $this->inject($this->quizService, 'quizSessionRepository', $mockRepository); */ $quiz = new Quiz(); // Should clean 0 snapshots and return value should be -1 (as there is not snapshots) $result = $this->quizService->cleanSnapshots($quiz); $this->assertSame(-1, $result); }
/** * @param Quiz $quiz */ public function cleanSnapshotsAction(Quiz $quiz) { $this->quizService->cleanSnapshots($quiz); $this->redirect('index'); }