function JsonSchemaTestTrait::getValidator

Get the JSON Schema Validator.

Override this method to add additional schema translations to the loader.

Return value

\JsonSchema\Validator Schema validator.

2 calls to JsonSchemaTestTrait::getValidator()
JsonSchemaTestTrait::doCheckSchemaAgainstMetaSchema in core/modules/serialization/tests/src/Traits/JsonSchemaTestTrait.php
Check a schema is valid against the meta-schema.
JsonSchemaTestTrait::testNormalizedValuesAgainstJsonSchema in core/modules/serialization/tests/src/Traits/JsonSchemaTestTrait.php
Test normalized values against the JSON schema.
1 method overrides JsonSchemaTestTrait::getValidator()
JsonApiJsonSchemaTestTrait::getValidator in core/modules/jsonapi/tests/src/Traits/JsonApiJsonSchemaTestTrait.php

File

core/modules/serialization/tests/src/Traits/JsonSchemaTestTrait.php, line 169

Class

JsonSchemaTestTrait
Trait for testing JSON Schema validity and fit to sample data.

Namespace

Drupal\Tests\serialization\Traits

Code

protected function getValidator() : Validator {
    return new Validator();
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.