/**
  * @test
  */
 public function shouldCreateHit()
 {
     //given
     $field = '25d';
     //when
     $this->post('/hit', ['field' => $field]);
     //then
     /** @var Hit $hit */
     $hit = Arrays::first(Hit::all());
     $this->assertEquals($this->gameUser->getId(), $hit->game_user_id);
     $this->assertEquals(25, $hit->field);
     $this->assertEquals(2, $hit->multiplier);
 }
Beispiel #2
0
 /**
  * @test
  * @dataProvider bestShotCalculate
  * @param $score
  * @param $expectedBestShots
  */
 public function shouldCalculateBestShot($score, $expectedBestShots)
 {
     //given
     $this->gameUser->updateAttributes(['score' => $score]);
     $game101 = new Game101($this->game);
     //when
     $bestShots = $game101->getPlayersBestShots();
     //then
     $this->assertEquals($expectedBestShots, Arrays::getValue($bestShots, $this->gameUser->getId(), []));
 }