We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 58fb6e9 commit a8bfe87Copy full SHA for a8bfe87
2 files changed
.gitignore
@@ -1,4 +1,5 @@
1
.idea
2
+.vscode
3
/vendor/
4
composer.lock
5
*.cache
test/JsonMachineTest/ItemsTest.php
@@ -146,4 +146,26 @@ public function testCountViaIteratorCount()
146
147
$this->assertSame(3, iterator_count($items));
148
}
149
+
150
+ public function testIssue125()
151
+ {
152
+ $data = '{
153
+ "code": "some value",
154
+ "key_one": 1,
155
+ "key_two": [1]
156
+ }';
157
158
+ $pointer = Items::fromString($data, ['pointer' => '/key_one']);
159
+ $result = iterator_to_array($pointer);
160
+ $this->assertSame([
161
+ 'key_one' => 1,
162
+ ], $result);
163
164
165
+ $pointer = Items::fromString($data, ['pointer' => '/key_two']);
166
167
168
+ 0 => 1,
169
170
+ }
171
0 commit comments