forked from friendica/php-json-ld
Initial update to port over changes from jsonld.js.
This commit is contained in:
parent
3309e2bd2b
commit
89dd522d45
|
@ -4,7 +4,7 @@
|
||||||
*
|
*
|
||||||
* @author Dave Longley
|
* @author Dave Longley
|
||||||
*
|
*
|
||||||
* Copyright (c) 2011-2012 Digital Bazaar, Inc. All rights reserved.
|
* Copyright (c) 2011-2013 Digital Bazaar, Inc. All rights reserved.
|
||||||
*/
|
*/
|
||||||
require_once('jsonld.php');
|
require_once('jsonld.php');
|
||||||
|
|
||||||
|
@ -261,7 +261,12 @@ class TestRunner {
|
||||||
'base' => 'http://json-ld.org/test-suite/tests/' . $test->input);
|
'base' => 'http://json-ld.org/test-suite/tests/' . $test->input);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
if(in_array('jld:NormalizeTest', $type)) {
|
if(in_array('jld:ApiErrorTest', $type)) {
|
||||||
|
echo "Skipping test \"{$test->name}\" of type: " .
|
||||||
|
json_encode($type) . $eol;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
else if(in_array('jld:NormalizeTest', $type)) {
|
||||||
$this->test($test->name);
|
$this->test($test->name);
|
||||||
$input = read_test_json($test->input, $filepath);
|
$input = read_test_json($test->input, $filepath);
|
||||||
$test->expect = read_test_nquads($test->expect, $filepath);
|
$test->expect = read_test_nquads($test->expect, $filepath);
|
||||||
|
@ -281,6 +286,12 @@ class TestRunner {
|
||||||
$test->expect = read_test_json($test->expect, $filepath);
|
$test->expect = read_test_json($test->expect, $filepath);
|
||||||
$result = jsonld_compact($input, $test->context, $options);
|
$result = jsonld_compact($input, $test->context, $options);
|
||||||
}
|
}
|
||||||
|
else if(in_array('jld:FlattenTest', $type)) {
|
||||||
|
$this->test($test->name);
|
||||||
|
$input = read_test_json($test->input, $filepath);
|
||||||
|
$test->expect = read_test_json($test->expect, $filepath);
|
||||||
|
$result = jsonld_flatten($input, null, $options);
|
||||||
|
}
|
||||||
else if(in_array('jld:FrameTest', $type)) {
|
else if(in_array('jld:FrameTest', $type)) {
|
||||||
$this->test($test->name);
|
$this->test($test->name);
|
||||||
$input = read_test_json($test->input, $filepath);
|
$input = read_test_json($test->input, $filepath);
|
||||||
|
|
3428
jsonld.php
3428
jsonld.php
File diff suppressed because it is too large
Load diff
Loading…
Reference in a new issue