Documentation

JsonLDApiTest extends JsonTestCase
in package

Tests JsonLD's API

Tags
author

Markus Lanthaler mail@markus-lanthaler.com

Table of Contents

Methods

assertJsonEquals()  : mixed
Asserts that two JSON structures are equal.
testCompaction()  : mixed
Tests the compaction API
testExpansion()  : mixed
Tests the expansion API
testFlatten()  : mixed
Tests the flattening API
testFrame()  : mixed
Tests the framing API
testGetDocument()  : mixed
Tests the document API
normalizeJson()  : mixed
Brings the keys of objects to a deterministic order to enable comparison of JSON structures

Methods

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 = ''

testCompaction()

Tests the compaction API

public testCompaction() : mixed
Tags
group

compaction

testExpansion()

Tests the expansion API

public testExpansion() : mixed
Tags
group

expansion

testFlatten()

Tests the flattening API

public testFlatten() : mixed
Tags
group

flattening

testFrame()

Tests the framing API

public testFrame() : mixed

This test intentionally uses the same fixtures as the flattening tests.

Tags
group

framing

testGetDocument()

Tests the document API

public testGetDocument() : mixed

This test intentionally uses the same fixtures as the flattening tests.

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.


        
On this page

Search results