Skip to content

Commit

Permalink
wp
Browse files Browse the repository at this point in the history
  • Loading branch information
rtrzebinski-usc committed Oct 4, 2020
1 parent b4119b9 commit 9121cd2
Showing 1 changed file with 6 additions and 12 deletions.
18 changes: 6 additions & 12 deletions tests/Unit/Services/LearningServiceTest.php
Expand Up @@ -103,15 +103,13 @@ public function itShould_findUserExerciseToLearn_manyExercises_onePoint()
$userExercise3 = $this->createUserExercise($user, $this->createExercise());
$userExercises = collect([$userExercise1, $userExercise2, $userExercise3]);

$this
->pointsCalculator
$this->pointsCalculator
->expects($this->exactly(3))
->method('calculatePoints')
->withConsecutive([$userExercise1], [$userExercise2], [$userExercise3])
->willReturnOnConsecutiveCalls(1, 1, 1);

$this->
randomizationService
$this->randomizationService
->expects($this->once())
->method('randomArrayElement')
->with([0, 1, 2])
Expand All @@ -131,15 +129,13 @@ public function itShould_findUserExerciseToLearn_manyExercises_variousPoints()
$userExercise3 = $this->createUserExercise($user, $this->createExercise());
$userExercises = collect([$userExercise1, $userExercise2, $userExercise3]);

$this
->pointsCalculator
$this->pointsCalculator
->expects($this->exactly(3))
->method('calculatePoints')
->withConsecutive([$userExercise1], [$userExercise2], [$userExercise3])
->willReturnOnConsecutiveCalls(1, 2, 3);

$this->
randomizationService
$this->randomizationService
->expects($this->once())
->method('randomArrayElement')
->with([0, 1, 1, 2, 2, 2])
Expand All @@ -159,15 +155,13 @@ public function itShould_findUserExerciseToLearn_excludePreviousExercise()
$previousUserExercise = $this->createUserExercise($user, $this->createExercise());
$userExercises = collect([$userExercise1, $userExercise2, $previousUserExercise]);

$this
->pointsCalculator
$this->pointsCalculator
->expects($this->exactly(2))
->method('calculatePoints')
->withConsecutive([$userExercise1], [$userExercise2])
->willReturnOnConsecutiveCalls(1, 1);

$this->
randomizationService
$this->randomizationService
->expects($this->once())
->method('randomArrayElement')
->with([0, 1])
Expand Down

0 comments on commit 9121cd2

Please sign in to comment.