[MediaWiki-commits] [Gerrit] mediawiki...Lingo[master]: Synchronize JsonSchema with mediawiki/core
jenkins-bot has submitted this change and it was merged. Change subject: Synchronize JsonSchema with mediawiki/core .. Synchronize JsonSchema with mediawiki/core See: Ie37e2ebc48684783abf8d99d2f775ee6a5988da7 Bug: T141281 Change-Id: I087f13f668bd2b32268b10f0c574d4859ab007cc --- M composer.json M tests/phpunit/Unit/LingoI18NTest.php 2 files changed, 3 insertions(+), 10 deletions(-) Approvals: Legoktm: Looks good to me, approved jenkins-bot: Verified diff --git a/composer.json b/composer.json index 6aa58cb..a3cd719 100644 --- a/composer.json +++ b/composer.json @@ -29,7 +29,7 @@ "php": ">=5.3.2", "ext-dom": "*", "composer/installers": ">1.0.12", - "justinrainbow/json-schema": "~1.0" + "justinrainbow/json-schema": "~3.0" }, "require-dev": { "jakub-onderka/php-parallel-lint": "0.9.2" diff --git a/tests/phpunit/Unit/LingoI18NTest.php b/tests/phpunit/Unit/LingoI18NTest.php index 836e852..7478454 100644 --- a/tests/phpunit/Unit/LingoI18NTest.php +++ b/tests/phpunit/Unit/LingoI18NTest.php @@ -26,8 +26,6 @@ namespace Lingo\Tests\Unit; -use JsonSchema\RefResolver; -use JsonSchema\Uri\UriRetriever; use JsonSchema\Validator; /** @@ -53,14 +51,9 @@ $data = json_decode( json_encode( $defined_vars[ 'magicWords' ] ) ); - $retriever = new UriRetriever; - $schema = $retriever->retrieve( 'file://' . realpath( __DIR__ . '/../Fixture/magicWordsSchema.json' ) ); - - $refResolver = new RefResolver( $retriever ); - $refResolver->resolve( $schema, 'file://' . realpath( __DIR__ . '/../Fixture/' ) ); - $validator = new Validator(); - $validator->check( $data, $schema ); + $validator->check( $data, (object) [ '$ref' => + 'file://' . realpath( __DIR__ . '/../Fixture/magicWordsSchema.json' ) ] ); // format error message $errors = implode( '', array_map( -- To view, visit https://gerrit.wikimedia.org/r/305343 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I087f13f668bd2b32268b10f0c574d4859ab007cc Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/Lingo Gerrit-Branch: master Gerrit-Owner: FlorianschmidtwelzowGerrit-Reviewer: Legoktm Gerrit-Reviewer: Siebrand Gerrit-Reviewer: jenkins-bot <> ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki...Lingo[master]: Synchronize JsonSchema with mediawiki/core
Florianschmidtwelzow has uploaded a new change for review. https://gerrit.wikimedia.org/r/305343 Change subject: Synchronize JsonSchema with mediawiki/core .. Synchronize JsonSchema with mediawiki/core See: Ie37e2ebc48684783abf8d99d2f775ee6a5988da7 Bug: T141281 Change-Id: I087f13f668bd2b32268b10f0c574d4859ab007cc --- M composer.json M tests/phpunit/Unit/LingoI18NTest.php 2 files changed, 3 insertions(+), 10 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Lingo refs/changes/43/305343/1 diff --git a/composer.json b/composer.json index 6aa58cb..a3cd719 100644 --- a/composer.json +++ b/composer.json @@ -29,7 +29,7 @@ "php": ">=5.3.2", "ext-dom": "*", "composer/installers": ">1.0.12", - "justinrainbow/json-schema": "~1.0" + "justinrainbow/json-schema": "~3.0" }, "require-dev": { "jakub-onderka/php-parallel-lint": "0.9.2" diff --git a/tests/phpunit/Unit/LingoI18NTest.php b/tests/phpunit/Unit/LingoI18NTest.php index 836e852..7478454 100644 --- a/tests/phpunit/Unit/LingoI18NTest.php +++ b/tests/phpunit/Unit/LingoI18NTest.php @@ -26,8 +26,6 @@ namespace Lingo\Tests\Unit; -use JsonSchema\RefResolver; -use JsonSchema\Uri\UriRetriever; use JsonSchema\Validator; /** @@ -53,14 +51,9 @@ $data = json_decode( json_encode( $defined_vars[ 'magicWords' ] ) ); - $retriever = new UriRetriever; - $schema = $retriever->retrieve( 'file://' . realpath( __DIR__ . '/../Fixture/magicWordsSchema.json' ) ); - - $refResolver = new RefResolver( $retriever ); - $refResolver->resolve( $schema, 'file://' . realpath( __DIR__ . '/../Fixture/' ) ); - $validator = new Validator(); - $validator->check( $data, $schema ); + $validator->check( $data, (object) [ '$ref' => + 'file://' . realpath( __DIR__ . '/../Fixture/magicWordsSchema.json' ) ] ); // format error message $errors = implode( '', array_map( -- To view, visit https://gerrit.wikimedia.org/r/305343 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I087f13f668bd2b32268b10f0c574d4859ab007cc Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/Lingo Gerrit-Branch: master Gerrit-Owner: Florianschmidtwelzow___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits