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; |
|
|
|
|
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
|
|
|
|
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:For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths