X7ROOT File Manager
Current Path:
/home/gfecatvj/sites/restate/vendor/mtdowling/jmespath.php/tests
home
/
gfecatvj
/
sites
/
restate
/
vendor
/
mtdowling
/
jmespath.php
/
tests
/
📁
..
📄
ComplianceTest.php
(4.12 KB)
📄
EnvTest.php
(878 B)
📄
FnDispatcherTest.php
(1006 B)
📄
LexerTest.php
(2.57 KB)
📄
ParserTest.php
(1.18 KB)
📄
SyntaxErrorExceptionTest.php
(987 B)
📄
TreeCompilerTest.php
(664 B)
📄
TreeInterpreterTest.php
(1.89 KB)
📄
UtilsTest.php
(3.4 KB)
📁
compliance
Editing: TreeInterpreterTest.php
<?php namespace JmesPath\Tests\Tree; use JmesPath\AstRuntime; use JmesPath\TreeInterpreter; use PHPUnit\Framework\TestCase; /** * @covers JmesPath\Tree\TreeInterpreter */ class TreeInterpreterTest extends TestCase { public function testReturnsNullWhenMergingNonArray() { $t = new TreeInterpreter(); $this->assertNull($t->visit([ 'type' => 'flatten', 'children' => [ ['type' => 'literal', 'value' => 1], ['type' => 'literal', 'value' => 1] ] ], [], [ 'runtime' => new AstRuntime() ])); } public function testWorksWithArrayObjectAsObject() { $runtime = new AstRuntime(); $this->assertEquals('baz', $runtime('foo.bar', new \ArrayObject([ 'foo' => new \ArrayObject(['bar' => 'baz']) ]))); } public function testWorksWithArrayObjectAsArray() { $runtime = new AstRuntime(); $this->assertEquals('baz', $runtime('foo[0].bar', new \ArrayObject([ 'foo' => new \ArrayObject([new \ArrayObject(['bar' => 'baz'])]) ]))); } public function testWorksWithArrayProjections() { $runtime = new AstRuntime(); $this->assertEquals( ['baz'], $runtime('foo[*].bar', new \ArrayObject([ 'foo' => new \ArrayObject([ new \ArrayObject([ 'bar' => 'baz' ]) ]) ])) ); } public function testWorksWithObjectProjections() { $runtime = new AstRuntime(); $this->assertEquals( ['baz'], $runtime('foo.*.bar', new \ArrayObject([ 'foo' => new \ArrayObject([ 'abc' => new \ArrayObject([ 'bar' => 'baz' ]) ]) ])) ); } }
Upload File
Create Folder