Completed
Push — master ( bd630a...f47f8d )
by Steve
01:55
created

FateDiceSpec   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 26
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 0
Metric Value
wmc 4
lcom 0
cbo 1
dl 0
loc 26
rs 10
c 0
b 0
f 0

4 Methods

Rating   Name   Duplication   Size   Complexity  
A it_is_initializable() 0 4 1
A it_has_a_name_of_dFATE() 0 4 1
A it_rolls_one_of_the_correct_values() 0 4 1
A getMatchers() 0 8 1
1
<?php
2
3
namespace spec\MeadSteve\DiceApi\Dice;
4
5
use PhpSpec\ObjectBehavior;
6
use Prophecy\Argument;
7
8
class FateDiceSpec extends ObjectBehavior
9
{
10
    function it_is_initializable()
11
    {
12
        $this->shouldHaveType(\MeadSteve\DiceApi\Dice::class);
13
    }
14
15
    function it_has_a_name_of_dFATE()
16
    {
17
        $this->name()->shouldBe("dFATE");
18
    }
19
20
    function it_rolls_one_of_the_correct_values()
21
    {
22
        $this->roll()->shouldBeOneOf(["+", "-", " "]);
23
    }
24
25
    public function getMatchers(): array
26
    {
27
        return [
28
            'beOneOf' => function ($value, $subject) {
29
                return in_array($value, $subject);
30
            },
31
        ];
32
    }
33
}
34