|
3 | 3 | namespace Illuminate\Tests\Support;
|
4 | 4 |
|
5 | 5 | use ArrayAccess;
|
6 |
| -use ArrayIterator; |
7 | 6 | use Illuminate\Contracts\Support\Htmlable;
|
8 | 7 | use Illuminate\Support\Env;
|
9 | 8 | use Illuminate\Support\Optional;
|
10 |
| -use IteratorAggregate; |
11 | 9 | use LogicException;
|
12 | 10 | use Mockery as m;
|
13 | 11 | use PHPUnit\Framework\TestCase;
|
@@ -89,18 +87,10 @@ public function testDataGetWithNestedArrays()
|
89 | 87 | ['name' => 'abigail'],
|
90 | 88 | ['name' => 'dayle'],
|
91 | 89 | ];
|
92 |
| - $arrayIterable = new SupportTestArrayIterable([ |
93 |
| - ['name' => 'taylor', 'email' => 'taylorotwell@gmail.com'], |
94 |
| - ['name' => 'abigail'], |
95 |
| - ['name' => 'dayle'], |
96 |
| - ]); |
97 | 90 |
|
98 | 91 | $this->assertEquals(['taylor', 'abigail', 'dayle'], data_get($array, '*.name'));
|
99 | 92 | $this->assertEquals(['taylorotwell@gmail.com', null, null], data_get($array, '*.email', 'irrelevant'));
|
100 | 93 |
|
101 |
| - $this->assertEquals(['taylor', 'abigail', 'dayle'], data_get($arrayIterable, '*.name')); |
102 |
| - $this->assertEquals(['taylorotwell@gmail.com', null, null], data_get($arrayIterable, '*.email', 'irrelevant')); |
103 |
| - |
104 | 94 | $array = [
|
105 | 95 | 'users' => [
|
106 | 96 | ['first' => 'taylor', 'last' => 'otwell', 'email' => 'taylorotwell@gmail.com'],
|
@@ -802,18 +792,3 @@ public function offsetUnset($offset)
|
802 | 792 | unset($this->attributes[$offset]);
|
803 | 793 | }
|
804 | 794 | }
|
805 |
| - |
806 |
| -class SupportTestArrayIterable implements IteratorAggregate |
807 |
| -{ |
808 |
| - protected $items = []; |
809 |
| - |
810 |
| - public function __construct($items = []) |
811 |
| - { |
812 |
| - $this->items = $items; |
813 |
| - } |
814 |
| - |
815 |
| - public function getIterator() |
816 |
| - { |
817 |
| - return new ArrayIterator($this->items); |
818 |
| - } |
819 |
| -} |
0 commit comments