public function check($test, $expect, $result) { global $eol; if (deep_compare($expect, $result)) { $this->passed += 1; echo "PASS{$eol}"; } else { $this->failed += 1; echo "FAIL{$eol}"; echo 'Expect: ' . print_r($expect, true) . $eol; echo 'Result: ' . print_r($result, true) . $eol; /* $flags = JSON_UNESCAPED_SLASHES | JSON_PRETTY_PRINT; echo 'JSON Expect: ' . json_encode(json_decode(expect, $flags)) . $eol; echo 'JSON Result: ' . json_encode(json_decode(result, $flags)) . $eol; */ } }
public function check($test, $expect, $result) { global $eol; if (deep_compare($expect, $result)) { $this->passed += 1; echo "PASS{$eol}"; } else { $this->failed += 1; echo "FAIL{$eol}"; echo 'Expect: ' . jsonld_encode($expect) . $eol; echo 'Result: ' . jsonld_encode($result) . $eol; } }
public function check($test, $expect, $result) { global $eol; if (in_array('jld:NormalizeTest', $test->{'@type'}) !== false) { $pass = JsonLdProcessor::compareNormalized($expect, $result); } else { $pass = deep_compare($expect, $result); } if ($pass) { $this->passed += 1; echo "PASS{$eol}"; } else { $this->failed += 1; echo "FAIL{$eol}"; echo 'Expect: ' . print_r($expect, true) . $eol; echo 'Result: ' . print_r($result, true) . $eol; /* $flags = JSON_UNESCAPED_SLASHES | JSON_PRETTY_PRINT; echo 'JSON Expect: ' . json_encode(json_decode(expect, $flags)) . $eol; echo 'JSON Result: ' . json_encode(json_decode(result, $flags)) . $eol; */ } }