Skip to content

Commit 6b19df6

Browse files
committed
Fix: Use real path to schema.json
1 parent 26d9607 commit 6b19df6

File tree

3 files changed

+20
-4
lines changed

3 files changed

+20
-4
lines changed

CHANGELOG.md

+13-2
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,15 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
77

88
## Unreleased
99

10-
For a full diff see [`2.2.3...master`][2.2.3...master].
10+
For a full diff see [`2.2.4...master`][2.2.4...master].
11+
12+
## [`2.2.4`][2.2.4]
13+
14+
For a full diff see [`2.2.3...2.2.4`][2.2.3...2.2.4].
15+
16+
### Fixed
17+
18+
* Use real path to `schema.json` ([#364]), by [@localheinz]
1119

1220
## [`2.2.3`][2.2.3]
1321

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

324333
[81bc3a8...0.1.0]: https://github.com/ergebnis/composer-normalize/compare/81bc3a8...0.1.0
325334
[0.1.0...0.2.0]: https://github.com/ergebnis/composer-normalize/compare/0.1.0...0.2.0
@@ -349,7 +358,8 @@ For a full diff see [`81bc3a8...0.1.0`][81bc3a8...0.1.0].
349358
[2.2.0...2.2.1]: https://github.com/ergebnis/composer-normalize/compare/2.2.0...2.2.1
350359
[2.2.1...2.2.2]: https://github.com/ergebnis/composer-normalize/compare/2.2.1...2.2.2
351360
[2.2.2...2.2.3]: https://github.com/ergebnis/composer-normalize/compare/2.2.2...2.2.3
352-
[2.2.3...master]: https://github.com/ergebnis/composer-normalize/compare/2.2.3...master
361+
[2.2.3...2.2.4]: https://github.com/ergebnis/composer-normalize/compare/2.2.3...2.2.4
362+
[2.2.4...master]: https://github.com/ergebnis/composer-normalize/compare/2.2.4...master
353363

354364
[#1]: https://github.com/ergebnis/composer-normalize/pull/1
355365
[#2]: https://github.com/ergebnis/composer-normalize/pull/2
@@ -393,6 +403,7 @@ For a full diff see [`81bc3a8...0.1.0`][81bc3a8...0.1.0].
393403
[#316]: https://github.com/ergebnis/composer-normalize/pull/316
394404
[#322]: https://github.com/ergebnis/composer-normalize/pull/322
395405
[#354]: https://github.com/ergebnis/composer-normalize/pull/354
406+
[#364]: https://github.com/ergebnis/composer-normalize/pull/364
396407

397408
[@ergebnis]: https://github.com/ergebnis
398409
[@ergebnis-bot]: https://github.com/ergebnis-bot

src/NormalizePlugin.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ public function getCommands(): array
4141
new Factory(),
4242
new Normalizer\Vendor\Composer\ComposerJsonNormalizer(\sprintf(
4343
'file://%s',
44-
__DIR__ . '/../resource/schema.json'
44+
\realpath(__DIR__ . '/../resource/schema.json')
4545
)),
4646
new Normalizer\Format\Formatter(new Printer\Printer()),
4747
new Diff\Differ(new Diff\Output\StrictUnifiedDiffOutputBuilder([

test/Integration/Command/NormalizeCommandTest.php

+6-1
Original file line numberDiff line numberDiff line change
@@ -246,7 +246,12 @@ public function testFailsWhenComposerJsonIsPresentButNotValid(CommandInvocation
246246

247247
$display = $output->fetch();
248248

249-
self::assertRegExp('/Original JSON is not valid according to schema ".*"/', $display);
249+
$message = \sprintf(
250+
'Original JSON is not valid according to schema "file://%s".',
251+
\realpath(__DIR__ . '/../../../resource/schema.json')
252+
);
253+
254+
self::assertContains($message, $display);
250255
self::assertContains('See https://getcomposer.org/doc/04-schema.md for details on the schema', $display);
251256
self::assertContains('No license specified, it is recommended to do so. For closed-source software you may use "proprietary" as license.', $display);
252257
self::assertEquals($initialState, $scenario->currentState());

0 commit comments

Comments
 (0)