Completed
Push — master ( 4a6305...d109f8 )
by Korotkov
07:59 queued 12s
created

AdapterTest::getRegistry()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 1
nc 1
nop 0
dl 0
loc 3
rs 10
c 0
b 0
f 0
1
<?php
2
3
declare(strict_types=1);
4
5
/**
6
 * @author    : Korotkov Danila <[email protected]>
7
 * @license   https://mit-license.org/ MIT
8
 */
9
10
namespace Structural\Adapter\Tests;
11
12
use Structural\Adapter\{Registry, Adapter, AnotherRegistry, RegistryInterface};
13
use PHPUnit\Framework\TestCase as PHPUnit_Framework_TestCase;
14
15
class AdapterTest extends PHPUnit_Framework_TestCase
16
{
17
    private Adapter $adapter;
0 ignored issues
show
Bug introduced by
This code did not parse for me. Apparently, there is an error somewhere around this line:

Syntax error, unexpected T_STRING, expecting T_FUNCTION or T_CONST
Loading history...
18
    private RegistryInterface $registry;
19
20
    protected function setUp(): void
21
    {
22
        $this->registry = new Registry();
23
        $this->adapter  = new Adapter(new AnotherRegistry());
24
    }
25
26
    public function testSecond()
27
    {
28
        $this->registry->setFirst('First');
29
        $this->assertEquals('First', $this->registry->getFirst());
30
        $this->registry->setSecond('3.14');
31
        $this->assertEquals('3.14', $this->registry->getSecond());
32
    }
33
34
    public function testAdapt()
35
    {
36
        $this->adapter->setFirst('First');
37
        $this->assertEquals('First', $this->adapter->getFirst());
38
        $this->adapter->setSecond('3.14');
39
        $this->assertEquals('3.14', $this->adapter->getSecond());
40
    }
41
}
42