Conditions | 1 |
Paths | 1 |
Total Lines | 8 |
Lines | 8 |
Ratio | 100 % |
Changes | 0 |
1 | <?php |
||
16 | View Code Duplication | function it_uses_the_json_encode_function_of_the_dice(Dice $dice) |
|
|
|||
17 | { |
||
18 | $dice->roll()->willReturn(5); |
||
19 | $dice->name()->willReturn("d6"); |
||
20 | |||
21 | $expectedJson = '{"success":true,"dice":[{"value":5,"type":"d6"}]}'; |
||
22 | $this->renderDice([$dice])->shouldReturn($expectedJson); |
||
23 | } |
||
24 | } |
||
25 |
Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.
You can also find more detailed suggestions in the “Code” section of your repository.