Passed
Pull Request — master (#14)
by Korotkov
01:41
created

AdapterTest::testAdapt()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 2
Bugs 0 Features 0
Metric Value
cc 1
eloc 4
c 2
b 0
f 0
nc 1
nop 0
dl 0
loc 6
rs 10
1
<?php
2
3
declare(strict_types=1);
4
5
/**
6
 * @author  : Jagepard <[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;
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...
14
15
class AdapterTest extends PHPUnit_Framework_TestCase
16
{
17
    private Adapter $adapter;
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