1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
declare(strict_types=1); |
4
|
|
|
|
5
|
|
|
namespace Xmf\Test\Key; |
6
|
|
|
|
7
|
|
|
use PHPUnit\Framework\TestCase; |
|
|
|
|
8
|
|
|
|
9
|
|
|
|
10
|
|
|
use Xmf\Key\ArrayStorage; |
11
|
|
|
|
12
|
|
|
class ArrayStorageTest extends TestCase |
13
|
|
|
{ |
14
|
|
|
/** |
15
|
|
|
* @var ArrayStorage |
16
|
|
|
*/ |
17
|
|
|
protected $object; |
18
|
|
|
|
19
|
|
|
/** |
20
|
|
|
* Sets up the fixture, for example, opens a network connection. |
21
|
|
|
* This method is called before a test is executed. |
22
|
|
|
*/ |
23
|
|
|
protected function setUp(): void |
24
|
|
|
{ |
25
|
|
|
$this->object = new ArrayStorage(); |
26
|
|
|
} |
27
|
|
|
|
28
|
|
|
/** |
29
|
|
|
* Tears down the fixture, for example, closes a network connection. |
30
|
|
|
* This method is called after a test is executed. |
31
|
|
|
*/ |
32
|
|
|
protected function tearDown(): void |
33
|
|
|
{ |
34
|
|
|
} |
35
|
|
|
|
36
|
|
|
public function testSave() |
37
|
|
|
{ |
38
|
|
|
$name = 'name'; |
39
|
|
|
$data = 'data'; |
40
|
|
|
$this->object->save($name, $data); |
41
|
|
|
$this->assertEquals($data, $this->object[$name]); |
42
|
|
|
} |
43
|
|
|
|
44
|
|
|
public function testFetch() |
45
|
|
|
{ |
46
|
|
|
$name = 'name'; |
47
|
|
|
$data = 'data'; |
48
|
|
|
$this->assertFalse($this->object->fetch($name)); |
49
|
|
|
$this->object->save($name, $data); |
50
|
|
|
$this->assertEquals($this->object->fetch($name), $data); |
51
|
|
|
} |
52
|
|
|
|
53
|
|
|
public function testExists() |
54
|
|
|
{ |
55
|
|
|
$name = 'name'; |
56
|
|
|
$data = 'data'; |
57
|
|
|
$this->assertFalse($this->object->exists($name)); |
58
|
|
|
$this->object->save($name, $data); |
59
|
|
|
$this->assertTrue($this->object->exists($name)); |
60
|
|
|
} |
61
|
|
|
|
62
|
|
|
public function testDelete() |
63
|
|
|
{ |
64
|
|
|
$name = 'name'; |
65
|
|
|
$data = 'data'; |
66
|
|
|
$this->object->save($name, $data); |
67
|
|
|
$this->assertTrue($this->object->exists($name)); |
68
|
|
|
$actual = $this->object->delete($name); |
69
|
|
|
$this->assertTrue($actual); |
70
|
|
|
$actual = $this->object->delete($name); |
71
|
|
|
$this->assertFalse($actual); |
72
|
|
|
$this->assertFalse($this->object->exists($name)); |
73
|
|
|
} |
74
|
|
|
} |
75
|
|
|
|
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