|
3 | 3 | namespace Webforge\Common; |
4 | 4 |
|
5 | 5 | use ArrayIterator; |
| 6 | +use Doctrine\Common\Collections\ArrayCollection; |
6 | 7 | use stdClass; |
7 | | -use Webforge\Collections\TraversableCollection; |
8 | 8 |
|
9 | 9 | class UtilTest extends \PHPUnit\Framework\TestCase |
10 | 10 | { |
@@ -64,17 +64,12 @@ public function testCastArray($item, $expected): void |
64 | 64 | ); |
65 | 65 | } |
66 | 66 |
|
67 | | - public static function provideCastArray() |
| 67 | + public static function provideCastArray(): array |
68 | 68 | { |
69 | 69 | $tests = []; |
70 | | - |
71 | | - $test = function () use (&$tests): void { |
72 | | - $tests[] = func_get_args(); |
73 | | - }; |
74 | | - |
75 | | - $test($iterator = new ArrayIterator([1, 2, 3]), [1, 2, 3]); |
76 | | - $test([1, 2, 3], [1, 2, 3]); |
77 | | - $test(new TraversableCollection(['0' => 'nil', '1' => 'one']), ['0' => 'nil', '1' => 'one']); |
| 70 | + $tests[] = [$iterator = new ArrayIterator([1, 2, 3]), [1, 2, 3]]; |
| 71 | + $tests[] = [[1, 2, 3], [1, 2, 3]]; |
| 72 | + $tests[] = [new ArrayCollection(['0' => 'nil', '1' => 'one']), ['0' => 'nil', '1' => 'one']]; |
78 | 73 |
|
79 | 74 | return $tests; |
80 | 75 | } |
|
0 commit comments