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

AdapterTest   A

Complexity

Total Complexity 5

Size/Duplication

Total Lines 47
Duplicated Lines 0 %

Importance

Changes 3
Bugs 0 Features 0
Metric Value
eloc 15
c 3
b 0
f 0
dl 0
loc 47
rs 10
wmc 5
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