Completed
Push — master ( 0bad36...7c076d )
by Steve
01:35
created

it_uses_the_json_encode_function_of_the_dice()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 8

Duplication

Lines 8
Ratio 100 %

Importance

Changes 0
Metric Value
dl 8
loc 8
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 1
1
<?php
2
3
namespace spec\MeadSteve\DiceApi\Renderer;
4
5
use MeadSteve\DiceApi\Dice;
6
use PhpSpec\ObjectBehavior;
7
use Prophecy\Argument;
8
9
class JsonSpec extends ObjectBehavior
10
{
11
    function it_is_initializable()
12
    {
13
        $this->shouldHaveType(\MeadSteve\DiceApi\Renderer\Json::class);
14
    }
15
16 View Code Duplication
    function it_uses_the_json_encode_function_of_the_dice(Dice $dice)
0 ignored issues
show
Duplication introduced by
This method seems to be duplicated in your project.

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.

Loading history...
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