public function testItShould_fetchRandomExercise() { $previousExerciseId = rand(1, 100); $exercise = $this->createExercise(); $this->exerciseRepository->method('fetchRandomExerciseOfLesson')->with($this->lesson->id, $this->user->id, $previousExerciseId)->willReturn($exercise); $this->assertEquals($exercise, $this->lesson->fetchRandomExercise($this->user->id, $previousExerciseId)); }
public function test_handleBadAnswer() { $this->exerciseRepository->expects($this->once())->method('handleBadAnswer')->with($this->exercise->id, $this->user->id); $this->exercise->handleBadAnswer($this->user->id); }