JohnDoeTest   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 29
Duplicated Lines 0 %

Coupling/Cohesion

Dependencies 3
Metric Value
wmc 3
cbo 3
dl 0
loc 29
rs 10

3 Methods

Rating   Name   Duplication   Size   Complexity  
A testPlay() 0 5 1
A getPlayer() 0 4 1
A getLosingPlayer() 0 4 1
1
<?php
2
3
namespace Tests\Unit\FizzBuzzDomain\Players;
4
5
use FizzBuzzDomain\Players\JohnDoe;
6
use Tests\Unit\GameDomain\Player\Players\AbstractPlayerTest;
7
use Utils\NumberGenerator\NumberGenerators\FakeNumberGenerator;
8
9
/**
10
 * JohnDoe Test
11
 */
12
class JohnDoeTest extends AbstractPlayerTest
13
{
14
    /**
15
     * {@inheritDoc}
16
     *
17
     * @dataProvider getSteps
18
     */
19
    public function testPlay($stepNumber)
20
    {
21
        $this->assertTrue($this->play($this->getPlayer(), $stepNumber));
22
        $this->assertFalse($this->play($this->getLosingPlayer(), $stepNumber));
23
    }
24
25
    /**
26
     * {@inheritDoc}
27
     */
28
    protected function getPlayer()
29
    {
30
        return new JohnDoe(new FakeNumberGenerator(1));
31
    }
32
33
    /**
34
     * @return \FizzBuzzDomain\Players\JohnDoe
35
     */
36
    protected function getLosingPlayer()
37
    {
38
        return new JohnDoe(new FakeNumberGenerator(0));
39
    }
40
}
41