function it_should_return_all_the_categories_that_match_a_given_dice_roll(DiceRoll $diceRoll, Category $c1, Category $c2, Category $c3)
 {
     $c1->evaluate($diceRoll)->willReturn(false);
     $c2->evaluate($diceRoll)->willReturn(true);
     $c3->evaluate($diceRoll)->willReturn(true);
     $this->match($diceRoll, $c1, $c2, $c3)->shouldReturn([$c2, $c3]);
 }
 function it_should_order_categories_by_top_score(DiceRoll $diceRoll, Category $category1, Category $category2, Category $category3, Category $category4)
 {
     $category1->score($diceRoll)->willReturn(50);
     $category2->score($diceRoll)->willReturn(34);
     $category3->score($diceRoll)->willReturn(23);
     $category4->score($diceRoll)->willReturn(45);
     $this->rank($diceRoll, $category1, $category2, $category3, $category4)->shouldReturn([$category1, $category4, $category2, $category3]);
 }
示例#3
0
 public function categoryName()
 {
     return $this->category->name();
 }