ResetTest   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 19
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 7
dl 0
loc 19
rs 10
c 0
b 0
f 0
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A testResetSetsNounsToEmptyArray() 0 9 1
A setUp() 0 6 1
1
<?php namespace Unit\Chekote\NounStore\Store;
2
3
use Unit\Chekote\Phake\Phake;
4
5
/**
6
 * @covers \Chekote\NounStore\Store::reset()
7
 */
8
class ResetTest extends StoreTestCase
9
{
10
    public function setUp(): void
11
    {
12
        parent::setUp();
13
14
        /* @noinspection PhpUndefinedMethodInspection */
15
        Phake::when($this->store)->reset()->thenCallParent();
16
    }
17
18
    public function testResetSetsNounsToEmptyArray(): void
19
    {
20
        $this->store->reset();
0 ignored issues
show
Bug introduced by
The method reset() does not exist on Phake\IMock. ( Ignorable by Annotation )

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

20
        $this->store->/** @scrutinizer ignore-call */ 
21
                      reset();

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
Bug introduced by
The method reset() does not exist on Unit\Chekote\NounStore\Store\StorePhake. ( Ignorable by Annotation )

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

20
        $this->store->/** @scrutinizer ignore-call */ 
21
                      reset();

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
21
22
        $store = Phake::makeVisible($this->store);
23
        /* @noinspection PhpUndefinedFieldInspection */
24
        {
25
            $this->assertEquals('array', gettype($store->nouns));
0 ignored issues
show
Bug Best Practice introduced by
The property nouns does not exist on Unit\Chekote\Phake\Proxies\VisibilityProxy. Since you implemented __get, consider adding a @property annotation.
Loading history...
26
            $this->assertCount(0, $store->nouns);
27
        }
28
    }
29
}
30