Failed Conditions
Push — complex_graph ( acfdbf...ffa5e4 )
by Donald
04:25 queued 01:50
created

SplitPossessionsTest   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 36
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 3
eloc 13
c 1
b 0
f 0
dl 0
loc 36
rs 10

3 Methods

Rating   Name   Duplication   Size   Complexity  
A nouns() 0 9 1
A testSuccessScenario() 0 6 1
A setUp() 0 6 1
1
<?php namespace Chekote\NounStore\Key;
2
3
use Chekote\Phake\Phake;
4
5
/**
6
 * @covers \Chekote\NounStore\Key::splitPossessions()
7
 */
8
class SplitPossessionsTest extends KeyTest
9
{
10
    public function setUp()
11
    {
12
        parent::setUp();
13
14
        /* @noinspection PhpUndefinedMethodInspection */
15
        Phake::when($this->key)->splitPossessions(Phake::anyParameters())->thenCallParent();
16
    }
17
18
    /**
19
     * @dataProvider nouns
20
     */
21
    public function testSuccessScenario($key, array $parts)
22
    {
23
        /* @noinspection PhpUndefinedMethodInspection */
24
        $this->assertSame(
25
            $parts,
26
            Phake::makeVisible($this->key)->splitPossessions($key)
0 ignored issues
show
Bug introduced by
The method splitPossessions() does not exist on Chekote\Phake\Proxies\VisibilityProxy. Since you implemented __call, consider adding a @method annotation. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

26
            Phake::makeVisible($this->key)->/** @scrutinizer ignore-call */ splitPossessions($key)
Loading history...
27
        );
28
    }
29
30
    /**
31
     * Data provider of possessive nouns and their component nouns.
32
     *
33
     * @return array[]
34
     */
35
    public function nouns()
36
    {
37
        return [
38
            ['Customer',                       ['Customer'                        ]],
39
            ["Customer's Car",                 ['Customer',     'Car'             ]],
40
            ["8th Customer's Car",             ['8th Customer', 'Car'             ]],
41
            ["Customer's 2nd Car",             ['Customer',     '2nd Car'         ]],
42
            ["7th Customer's 4th Car",         ['7th Customer', '4th Car'         ]],
43
            ["7th Customer's 4th Car's Wheel", ['7th Customer', '4th Car', 'Wheel']],
44
        ];
45
    }
46
}
47