Completed
Push — master ( 53983a...0b6d47 )
by Korotkov
02:49 queued 01:14
created

AdapterTest::testAdaptFirstValue()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
cc 1
eloc 2
c 1
b 0
f 1
nc 1
nop 0
dl 0
loc 4
rs 10
1
<?php
2
3
declare(strict_types=1);
4
5
/**
6
 * @author    : Korotkov Danila <[email protected]>
7
 * @copyright Copyright (c) 2018, Korotkov Danila
8
 * @license   http://www.gnu.org/licenses/gpl.html GNU GPLv3.0
9
 */
10
11
use PHPUnit\Framework\TestCase as PHPUnit_Framework_TestCase;
0 ignored issues
show
Bug introduced by
The type PHPUnit\Framework\TestCase was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
12
use Structural\Adapter\AnotherRegistryAdapter;
13
use Structural\Adapter\Registry;
14
15
16
/**
17
 * Class SingletonsPoolTest
18
 */
19
class AdapterTest extends PHPUnit_Framework_TestCase
20
{
21
22
    protected $registry;
23
    protected $adapter;
24
25
    protected function setUp(): void
26
    {
27
        $this->registry = new Registry();
28
        $this->adapter  = new AnotherRegistryAdapter($this->registry);
29
    }
30
31
    public function testFirstValue()
32
    {
33
        $this->getRegistry()->setFirstValue('FirstValue');
34
        $this->assertEquals('FirstValue', $this->getRegistry()->getFirstValue());
35
    }
36
37
    public function testSecondValue()
38
    {
39
        $this->getRegistry()->setSecondValue('3.14');
40
        $this->assertEquals('3.14', $this->getRegistry()->getSecondValue());
41
    }
42
43
    public function testAdaptFirstValue()
44
    {
45
        $this->getAdapter()->setFirstValue('FirstValue');
46
        $this->assertEquals(0, $this->getAdapter()->getFirstValue());
47
    }
48
49
    public function testAdaptSecondValue()
50
    {
51
        $this->getAdapter()->setSecondValue('3.14');
52
        $this->assertEquals(3, $this->getAdapter()->getSecondValue());
53
    }
54
55
    /**
56
     * @return mixed
57
     */
58
    public function getRegistry()
59
    {
60
        return $this->registry;
61
    }
62
63
    /**
64
     * @return mixed
65
     */
66
    public function getAdapter()
67
    {
68
        return $this->adapter;
69
    }
70
}
71