Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test case have a error #12

Open
jacky1982 opened this issue Jan 19, 2016 · 1 comment
Open

test case have a error #12

jacky1982 opened this issue Jan 19, 2016 · 1 comment

Comments

@jacky1982
Copy link

public function testGetAllByKeyFiltered()
{
$data = $this->jsonStore->get("$..book[(@.code=='02.01')].category");
$expected = ["fiction", "fiction"];
$this->assertEquals($data, $expected);
}

$data = $this->jsonStore->get("$..book[?(@.code=='02.01')].category"); ? discard

@phptek
Copy link

phptek commented Jul 1, 2016

Yep, I see this too:

#> ../../vendor/bin/phpunit jsonpath/tests/
PHPUnit 3.7.38 by Sebastian Bergmann.

...E

Time: 98 ms, Memory: 3.00Mb

There was 1 error:

1) tests\JsonStoreTest::testGetAllByKeyFiltered
Undefined index: code

/home/sites/htdocs/vendor/peekmo/jsonpath/src/Peekmo/JsonPath/JsonPath.php:235
/home/sites/htdocs/vendor/peekmo/jsonpath/src/Peekmo/JsonPath/JsonPath.php:164
/home/sites/htdocs/vendor/peekmo/jsonpath/src/Peekmo/JsonPath/JsonPath.php:154
/home/sites/htdocs/vendor/peekmo/jsonpath/src/Peekmo/JsonPath/JsonPath.php:160
/home/sites/htdocs/vendor/peekmo/jsonpath/src/Peekmo/JsonPath/JsonPath.php:190
/home/sites/htdocs/vendor/peekmo/jsonpath/src/Peekmo/JsonPath/JsonPath.php:204
/home/sites/htdocs/vendor/peekmo/jsonpath/src/Peekmo/JsonPath/JsonPath.php:161
/home/sites/htdocs/vendor/peekmo/jsonpath/src/Peekmo/JsonPath/JsonPath.php:34
/home/sites/htdocs/vendor/peekmo/jsonpath/src/Peekmo/JsonPath/JsonStore.php:217
/home/sites/htdocs/vendor/peekmo/jsonpath/src/Peekmo/JsonPath/JsonStore.php:88
/home/sites/htdocs/vendor/peekmo/jsonpath/tests/JsonStoreTest.php:92

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants