Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion src/Assert.php
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ public static function assertJsonMatchesSchema($content, $schema = null)

if ($schema !== null) {
$schemaObject = json_decode(file_get_contents($schema));
self::$schemaStorage->addSchema( 'file://' . $schema, $schemaObject);
self::$schemaStorage->addSchema('file://'.$schema, $schemaObject);
}

$validator = new Validator(new Factory(self::$schemaStorage));
Expand All @@ -78,6 +78,7 @@ public static function assertJsonMatchesSchema($content, $schema = null)
*
* @param string|null $schema Path to the schema file
* @param array|object $content JSON array or object
*
* @deprecated This will be removed in the next major version (4.x).
*/
public static function assertJsonMatchesSchemaDepr($schema, $content)
Expand Down
1 change: 1 addition & 0 deletions tests/AssertTraitImpl.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ public function setUp()
/**
* @param string $id
* @param string $schema
*
* @return SchemaStorage
*/
public function testWithSchemaStore($id, $schema)
Expand Down
4 changes: 2 additions & 2 deletions tests/AssertTraitTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -109,10 +109,10 @@ public function testAssertWithSchemaStore()
$obj = new AssertTraitImpl();
$obj->setUp();

$schemastore = $obj->testWithSchemaStore('foobar', (object)['type' => 'string']);
$schemastore = $obj->testWithSchemaStore('foobar', (object) ['type' => 'string']);

self::assertInstanceOf('JsonSchema\SchemaStorage', $schemastore);
self::assertEquals($schemastore->getSchema('foobar'), (object)['type' => 'string']);
self::assertEquals($schemastore->getSchema('foobar'), (object) ['type' => 'string']);
}

public function assertJsonValueEqualsProvider()
Expand Down