1
1
<?php
2
2
declare (strict_types=1 );
3
3
4
-
5
4
namespace DMS \PHPUnitExtensions \ArraySubset \Tests \Unit \Constraint ;
6
5
7
6
use ArrayAccessible ;
18
17
19
18
final class ArraySubsetTest extends TestCase
20
19
{
20
+ /**
21
+ * @return mixed[]
22
+ */
21
23
public static function evaluateDataProvider (): array
22
24
{
23
25
return [
24
- 'loose array subset and array other ' => [
26
+ 'loose array subset and array other ' => [
25
27
'expected ' => true ,
26
28
'subset ' => ['bar ' => 0 ],
27
29
'other ' => ['foo ' => '' , 'bar ' => '0 ' ],
28
30
'strict ' => false ,
29
31
],
30
- 'strict array subset and array other ' => [
32
+ 'strict array subset and array other ' => [
31
33
'expected ' => false ,
32
34
'subset ' => ['bar ' => 0 ],
33
35
'other ' => ['foo ' => '' , 'bar ' => '0 ' ],
34
36
'strict ' => true ,
35
37
],
36
- 'loose array subset and ArrayObject other ' => [
38
+ 'loose array subset and ArrayObject other ' => [
37
39
'expected ' => true ,
38
40
'subset ' => ['bar ' => 0 ],
39
41
'other ' => new ArrayObject (['foo ' => '' , 'bar ' => '0 ' ]),
@@ -49,9 +51,9 @@ public static function evaluateDataProvider(): array
49
51
}
50
52
51
53
/**
52
- * @param array|Traversable $subset
53
- * @param array|Traversable $other
54
- * @param bool $strict
54
+ * @param array|Traversable|mixed[] $subset
55
+ * @param array|Traversable|mixed[] $other
56
+ * @param bool $strict
55
57
*
56
58
* @throws ExpectationFailedException
57
59
* @throws InvalidArgumentException
@@ -92,19 +94,25 @@ public function testIsCountable(): void
92
94
{
93
95
$ reflection = new ReflectionClass (ArraySubset::class);
94
96
95
- $ this ->assertTrue ($ reflection ->implementsInterface (Countable::class), sprintf (
96
- 'Failed to assert that ArraySubset implements "%s". ' ,
97
- Countable::class
98
- ));
97
+ $ this ->assertTrue (
98
+ $ reflection ->implementsInterface (Countable::class),
99
+ sprintf (
100
+ 'Failed to assert that ArraySubset implements "%s". ' ,
101
+ Countable::class
102
+ )
103
+ );
99
104
}
100
105
101
106
public function testIsSelfDescribing (): void
102
107
{
103
108
$ reflection = new ReflectionClass (ArraySubset::class);
104
109
105
- $ this ->assertTrue ($ reflection ->implementsInterface (SelfDescribing::class), sprintf (
106
- 'Failed to assert that Array implements "%s". ' ,
107
- SelfDescribing::class
108
- ));
110
+ $ this ->assertTrue (
111
+ $ reflection ->implementsInterface (SelfDescribing::class),
112
+ sprintf (
113
+ 'Failed to assert that Array implements "%s". ' ,
114
+ SelfDescribing::class
115
+ )
116
+ );
109
117
}
110
118
}
0 commit comments