Skip to content

Commit

Permalink
Merge pull request #364 from ergebnis/fix/real-path
Browse files Browse the repository at this point in the history
Fix: Use real path to schema.json
  • Loading branch information
localheinz authored Feb 22, 2020
2 parents 26d9607 + 6b19df6 commit 069fadf
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 4 deletions.
15 changes: 13 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,15 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## Unreleased

For a full diff see [`2.2.3...master`][2.2.3...master].
For a full diff see [`2.2.4...master`][2.2.4...master].

## [`2.2.4`][2.2.4]

For a full diff see [`2.2.3...2.2.4`][2.2.3...2.2.4].

### Fixed

* Use real path to `schema.json` ([#364]), by [@localheinz]

## [`2.2.3`][2.2.3]

Expand Down Expand Up @@ -320,6 +328,7 @@ For a full diff see [`81bc3a8...0.1.0`][81bc3a8...0.1.0].
[2.2.1]: https://github.com/ergebnis/composer-normalize/releases/tag/2.2.1
[2.2.2]: https://github.com/ergebnis/composer-normalize/releases/tag/2.2.2
[2.2.3]: https://github.com/ergebnis/composer-normalize/releases/tag/2.2.3
[2.2.4]: https://github.com/ergebnis/composer-normalize/releases/tag/2.2.4

[81bc3a8...0.1.0]: https://github.com/ergebnis/composer-normalize/compare/81bc3a8...0.1.0
[0.1.0...0.2.0]: https://github.com/ergebnis/composer-normalize/compare/0.1.0...0.2.0
Expand Down Expand Up @@ -349,7 +358,8 @@ For a full diff see [`81bc3a8...0.1.0`][81bc3a8...0.1.0].
[2.2.0...2.2.1]: https://github.com/ergebnis/composer-normalize/compare/2.2.0...2.2.1
[2.2.1...2.2.2]: https://github.com/ergebnis/composer-normalize/compare/2.2.1...2.2.2
[2.2.2...2.2.3]: https://github.com/ergebnis/composer-normalize/compare/2.2.2...2.2.3
[2.2.3...master]: https://github.com/ergebnis/composer-normalize/compare/2.2.3...master
[2.2.3...2.2.4]: https://github.com/ergebnis/composer-normalize/compare/2.2.3...2.2.4
[2.2.4...master]: https://github.com/ergebnis/composer-normalize/compare/2.2.4...master

[#1]: https://github.com/ergebnis/composer-normalize/pull/1
[#2]: https://github.com/ergebnis/composer-normalize/pull/2
Expand Down Expand Up @@ -393,6 +403,7 @@ For a full diff see [`81bc3a8...0.1.0`][81bc3a8...0.1.0].
[#316]: https://github.com/ergebnis/composer-normalize/pull/316
[#322]: https://github.com/ergebnis/composer-normalize/pull/322
[#354]: https://github.com/ergebnis/composer-normalize/pull/354
[#364]: https://github.com/ergebnis/composer-normalize/pull/364

[@ergebnis]: https://github.com/ergebnis
[@ergebnis-bot]: https://github.com/ergebnis-bot
Expand Down
2 changes: 1 addition & 1 deletion src/NormalizePlugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ public function getCommands(): array
new Factory(),
new Normalizer\Vendor\Composer\ComposerJsonNormalizer(\sprintf(
'file://%s',
__DIR__ . '/../resource/schema.json'
\realpath(__DIR__ . '/../resource/schema.json')
)),
new Normalizer\Format\Formatter(new Printer\Printer()),
new Diff\Differ(new Diff\Output\StrictUnifiedDiffOutputBuilder([
Expand Down
7 changes: 6 additions & 1 deletion test/Integration/Command/NormalizeCommandTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,12 @@ public function testFailsWhenComposerJsonIsPresentButNotValid(CommandInvocation

$display = $output->fetch();

self::assertRegExp('/Original JSON is not valid according to schema ".*"/', $display);
$message = \sprintf(
'Original JSON is not valid according to schema "file://%s".',
\realpath(__DIR__ . '/../../../resource/schema.json')
);

self::assertContains($message, $display);
self::assertContains('See https://getcomposer.org/doc/04-schema.md for details on the schema', $display);
self::assertContains('No license specified, it is recommended to do so. For closed-source software you may use "proprietary" as license.', $display);
self::assertEquals($initialState, $scenario->currentState());
Expand Down

0 comments on commit 069fadf

Please sign in to comment.