Passed
Branch scrutinizer_new_php_analysis (b739aa)
by Donald
02:21
created

AssertTest   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 31
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 2
dl 0
loc 31
c 0
b 0
f 0
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A setUp() 0 9 1
A tearDown() 0 3 1
1
<?php namespace Chekote\NounStore\Assert;
2
3
use Chekote\NounStore\Assert;
4
use Chekote\NounStore\Key;
5
use Chekote\NounStore\Store;
6
use Chekote\NounStore\Store\StoreTest;
7
use Chekote\Phake\Phake;
8
use Phake_IMock;
9
use PHPUnit\Framework\TestCase;
10
11
abstract class AssertTest extends TestCase
12
{
13
    /** @var Assert|Phake_IMock */
14
    protected $assert;
15
16
    /** @var Store|Phake_IMock */
17
    protected $store;
18
19
    /** @var Key|Phake_IMock */
20
    protected $key;
21
22
    /**
23
     * Sets up the environment before each test.
24
     */
25
    public function setUp()
26
    {
27
        $this->key = Phake::strictMock(Key::class);
28
        $this->store = Phake::strictMockWithConstructor(Store::class, $this->key);
0 ignored issues
show
Bug introduced by
$this->key of type Phake_IMock is incompatible with the type array expected by parameter $args of Chekote\Phake\Phake::strictMockWithConstructor(). ( Ignorable by Annotation )

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

28
        $this->store = Phake::strictMockWithConstructor(Store::class, /** @scrutinizer ignore-type */ $this->key);
Loading history...
29
30
        /* @noinspection PhpUndefinedFieldInspection */
31
        Phake::makeVisible($this->store)->nouns = [StoreTest::KEY => [StoreTest::FIRST_VALUE, StoreTest::SECOND_VALUE]];
0 ignored issues
show
Bug Best Practice introduced by
The property nouns does not exist on Chekote\Phake\Proxies\VisibilityProxy. Since you implemented __set, consider adding a @property annotation.
Loading history...
32
33
        $this->assert = Phake::strictMockWithConstructor(Assert::class, $this->store, $this->key);
34
    }
35
36
    /**
37
     * Tears down the environment after each test.
38
     */
39
    public function tearDown()
40
    {
41
        $this->assert = null;
42
    }
43
}
44