Documentation

W3CTestSuiteTest extends JsonTestCase
in package

The official W3C JSON-LD test suite.

Tags
link

Official W3C JSON-LD test suite

author

Markus Lanthaler mail@markus-lanthaler.com

Table of Contents

Properties

$basedir  : mixed
The base directory from which the test manifests, input, and output files should be read.
$baseurl  : mixed
The URL corresponding to the base directory
$id  : string

Methods

__construct()  : mixed
Constructs a test case with the given name.
assertJsonEquals()  : mixed
Asserts that two JSON structures are equal.
compactionProvider()  : mixed
Provides compaction test cases.
errorProvider()  : mixed
Provides error test cases.
expansionProvider()  : mixed
Provides expansion test cases.
flattenProvider()  : mixed
Provides flattening test cases.
framingProvider()  : mixed
Provides framing test cases.
fromRdfProvider()  : mixed
Provides conversion to quads test cases.
getTestId()  : string
Returns the test identifier.
remoteDocumentLoadingProvider()  : mixed
Provides remote document loading test cases.
testCompaction()  : mixed
Tests compaction.
testError()  : mixed
Tests errors (uses flattening).
testExpansion()  : mixed
Tests expansion.
testFlatten()  : mixed
Tests flattening.
testFraming()  : mixed
Tests framing.
testFromRdf()  : mixed
Tests conversion from quads.
testRemoteDocumentLoading()  : mixed
Tests remote document loading.
testToRdf()  : mixed
Tests conversion to RDF quads.
toRdfProvider()  : mixed
Provides conversion to RDF quads test cases.
normalizeJson()  : mixed
Brings the keys of objects to a deterministic order to enable comparison of JSON structures
replaceBaseUrl()  : string
Replaces the base URL 'http://json-ld.org/' with 'https://json-ld.org:443/'.

Properties

$basedir

The base directory from which the test manifests, input, and output files should be read.

private mixed $basedir

$baseurl

The URL corresponding to the base directory

private mixed $baseurl = 'http://json-ld.org/test-suite/tests/'

Methods

__construct()

Constructs a test case with the given name.

public __construct([null|string $name = null ][, array<string|int, mixed> $data = array() ][, string $dataName = '' ]) : mixed
Parameters
$name : null|string = null
$data : array<string|int, mixed> = array()
$dataName : string = ''

assertJsonEquals()

Asserts that two JSON structures are equal.

public static assertJsonEquals(object|array<string|int, mixed> $expected, object|array<string|int, mixed> $actual[, string $message = '' ]) : mixed
Parameters
$expected : object|array<string|int, mixed>
$actual : object|array<string|int, mixed>
$message : string = ''

compactionProvider()

Provides compaction test cases.

public compactionProvider() : mixed

errorProvider()

Provides error test cases.

public errorProvider() : mixed

expansionProvider()

Provides expansion test cases.

public expansionProvider() : mixed

flattenProvider()

Provides flattening test cases.

public flattenProvider() : mixed

framingProvider()

Provides framing test cases.

public framingProvider() : mixed

fromRdfProvider()

Provides conversion to quads test cases.

public fromRdfProvider() : mixed

getTestId()

Returns the test identifier.

public getTestId() : string
Return values
string

The test identifier

remoteDocumentLoadingProvider()

Provides remote document loading test cases.

public remoteDocumentLoadingProvider() : mixed

testCompaction()

Tests compaction.

public testCompaction(string $name, object $test, object $options) : mixed
Parameters
$name : string

The test name.

$test : object

The test definition.

$options : object

The options to configure the algorithms.

Tags
group

compaction

dataProvider

compactionProvider

testError()

Tests errors (uses flattening).

public testError(string $name, object $test, object $options) : mixed
Parameters
$name : string

The test name.

$test : object

The test definition.

$options : object

The options to configure the algorithms.

Tags
group

errors

dataProvider

errorProvider

testExpansion()

Tests expansion.

public testExpansion(string $name, object $test, object $options) : mixed
Parameters
$name : string

The test name.

$test : object

The test definition.

$options : object

The options to configure the algorithms.

Tags
group

expansion

dataProvider

expansionProvider

testFlatten()

Tests flattening.

public testFlatten(string $name, object $test, object $options) : mixed
Parameters
$name : string

The test name.

$test : object

The test definition.

$options : object

The options to configure the algorithms.

Tags
group

flattening

dataProvider

flattenProvider

testFraming()

Tests framing.

public testFraming(string $name, object $test, object $options) : mixed
Parameters
$name : string

The test name.

$test : object

The test definition.

$options : object

The options to configure the algorithms.

Tags
group

framing

dataProvider

framingProvider

testFromRdf()

Tests conversion from quads.

public testFromRdf(string $name, object $test, object $options) : mixed
Parameters
$name : string

The test name.

$test : object

The test definition.

$options : object

The options to configure the algorithms.

Tags
group

fromRdf

dataProvider

fromRdfProvider

testRemoteDocumentLoading()

Tests remote document loading.

public testRemoteDocumentLoading(string $name, object $test, object $options) : mixed
Parameters
$name : string

The test name.

$test : object

The test definition.

$options : object

The options to configure the algorithms.

Tags
group

remote

dataProvider

remoteDocumentLoadingProvider

testToRdf()

Tests conversion to RDF quads.

public testToRdf(string $name, object $test, object $options) : mixed
Parameters
$name : string

The test name.

$test : object

The test definition.

$options : object

The options to configure the algorithms.

Tags
group

toRdf

dataProvider

toRdfProvider

toRdfProvider()

Provides conversion to RDF quads test cases.

public toRdfProvider() : mixed

normalizeJson()

Brings the keys of objects to a deterministic order to enable comparison of JSON structures

private static normalizeJson(mixed $element) : mixed
Parameters
$element : mixed

The element to normalize.

Return values
mixed

The same data with all object keys ordered in a deterministic way.

replaceBaseUrl()

Replaces the base URL 'http://json-ld.org/' with 'https://json-ld.org:443/'.

private replaceBaseUrl(string $input) : string

The test location of the test suite has been changed as the site has been updated to use HTTPS everywhere.

Parameters
$input : string

The input string.

Return values
string

The input string with all occurrences of the old base URL replaced with the new HTTPS-based one.


        
On this page

Search results