Failed Conditions
Pull Request — master (#49)
by Donald
03:34 queued 02:03
created

SplitPossessionsTest::setUp()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 2
c 1
b 0
f 0
dl 0
loc 6
rs 10
cc 1
nc 1
nop 0
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
    /** @var string */
11
    const KEY = 'Customer';
12
13
    public function setUp()
14
    {
15
        parent::setUp();
16
17
        /* @noinspection PhpUndefinedMethodInspection */
18
        Phake::when($this->key)->splitPossessions(Phake::anyParameters())->thenCallParent();
19
    }
20
21
    /**
22
     * @dataProvider nouns
23
     */
24
    public function testSuccessScenario($key, array $parts)
25
    {
26
        /* @noinspection PhpUndefinedMethodInspection */
27
        $this->assertSame(
28
            $parts,
29
            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

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