diff --git a/CHANGELOG.md b/CHANGELOG.md
index e585186f..1a42e2ba 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -6,7 +6,15 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
## Unreleased
-For a full diff see [`2.4.0...master`][2.4.0...master].
+For a full diff see [`2.5.0...master`][2.5.0...master].
+
+## [`2.5.0`][2.5.0]
+
+For a full diff see [`2.4.0...2.5.0`][2.4.0...2.5.0].
+
+### Changed
+
+* Apply lax validation to `composer.json` ([#416]), by [@localheinz]
## [`2.4.0`][2.4.0]
@@ -365,6 +373,7 @@ For a full diff see [`81bc3a8...0.1.0`][81bc3a8...0.1.0].
[2.3.1]: https://github.com/ergebnis/composer-normalize/releases/tag/2.3.1
[2.3.2]: https://github.com/ergebnis/composer-normalize/releases/tag/2.3.2
[2.4.0]: https://github.com/ergebnis/composer-normalize/releases/tag/2.4.0
+[2.5.0]: https://github.com/ergebnis/composer-normalize/releases/tag/2.5.0
[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
@@ -399,7 +408,8 @@ For a full diff see [`81bc3a8...0.1.0`][81bc3a8...0.1.0].
[2.3.0...2.3.1]: https://github.com/ergebnis/composer-normalize/compare/2.3.0...2.3.1
[2.3.1...2.3.2]: https://github.com/ergebnis/composer-normalize/compare/2.3.1...2.3.2
[2.3.2...2.4.0]: https://github.com/ergebnis/composer-normalize/compare/2.4.0...master
-[2.4.0...master]: https://github.com/ergebnis/composer-normalize/compare/2.4.0...master
+[2.4.0...2.5.0]: https://github.com/ergebnis/composer-normalize/compare/2.4.0...2.5.0
+[2.5.0...master]: https://github.com/ergebnis/composer-normalize/compare/2.5.0...master
[#1]: https://github.com/ergebnis/composer-normalize/pull/1
[#2]: https://github.com/ergebnis/composer-normalize/pull/2
@@ -449,6 +459,7 @@ For a full diff see [`81bc3a8...0.1.0`][81bc3a8...0.1.0].
[#380]: https://github.com/ergebnis/composer-normalize/pull/380
[#406]: https://github.com/ergebnis/composer-normalize/pull/406
[#412]: https://github.com/ergebnis/composer-normalize/pull/412
+[#416]: https://github.com/ergebnis/composer-normalize/pull/416
[@ergebnis]: https://github.com/ergebnis
[@ergebnis-bot]: https://github.com/ergebnis-bot
diff --git a/Makefile b/Makefile
index 0e6ef185..01016019 100644
--- a/Makefile
+++ b/Makefile
@@ -26,7 +26,7 @@ help: ## Displays this list of targets with descriptions
.PHONY: phar
phar: vendor ## Builds a phar with humbug/box
phar/box.phar validate box.json
- composer require composer/composer:${COMPOSER_VERSION} --no-interaction --no-progress --no-suggest
+ composer require composer/composer:${COMPOSER_VERSION} --no-interaction --no-progress --no-suggest --update-with-dependencies
phar/box.phar compile --config=box.json
git checkout HEAD -- composer.json composer.lock
phar/box.phar info .build/phar/composer-normalize.phar
diff --git a/box.json b/box.json
index 74e2cb27..9be0521b 100644
--- a/box.json
+++ b/box.json
@@ -6,7 +6,8 @@
],
"compression": "GZ",
"files": [
- "resource/schema.json"
+ "resource/schema.json",
+ "resource/schema-lax.json"
],
"git": "git",
"main": "phar/composer-normalize.php",
diff --git a/composer-require-checker.json b/composer-require-checker.json
index 06864f6a..6ec5469b 100644
--- a/composer-require-checker.json
+++ b/composer-require-checker.json
@@ -21,6 +21,7 @@
"Composer\\Factory",
"Composer\\IO\\IOInterface",
"Composer\\Json\\JsonFile",
+ "Composer\\Json\\JsonValidationException",
"Composer\\Plugin\\Capability\\CommandProvider",
"Composer\\Plugin\\Capable",
"Composer\\Plugin\\PluginInterface",
diff --git a/phar/composer-normalize.php b/phar/composer-normalize.php
index 78e4326f..6596b781 100644
--- a/phar/composer-normalize.php
+++ b/phar/composer-normalize.php
@@ -22,7 +22,7 @@
$command = new Normalize\Command\NormalizeCommand(
new Factory(),
- new Normalizer\Vendor\Composer\ComposerJsonNormalizer(__DIR__ . '/../resource/schema.json'),
+ new Normalizer\Vendor\Composer\ComposerJsonNormalizer(__DIR__ . '/../resource/schema-lax.json'),
new Normalizer\Format\Formatter(new Printer\Printer()),
new Diff\Differ(new Diff\Output\StrictUnifiedDiffOutputBuilder([
'fromFile' => 'original',
diff --git a/resource/schema-lax.json b/resource/schema-lax.json
new file mode 100644
index 00000000..43ad8a21
--- /dev/null
+++ b/resource/schema-lax.json
@@ -0,0 +1,6 @@
+{
+ "$schema": "http://json-schema.org/draft-04/schema#",
+ "$ref": "schema.json",
+ "additionalProperties": true,
+ "required": []
+}
diff --git a/src/Command/NormalizeCommand.php b/src/Command/NormalizeCommand.php
index dc40c36f..8c6bc1aa 100644
--- a/src/Command/NormalizeCommand.php
+++ b/src/Command/NormalizeCommand.php
@@ -15,6 +15,7 @@
use Composer\Command;
use Composer\Factory;
+use Composer\IO;
use Ergebnis\Composer\Normalize\Exception;
use Ergebnis\Json\Normalizer;
use Localheinz\Diff;
@@ -121,19 +122,10 @@ protected function execute(Console\Input\InputInterface $input, Console\Output\O
$composerFile = Factory::getComposerFile();
}
- try {
- $composer = $this->factory->createComposer(
- $io,
- $composerFile
- );
- } catch (\Exception $exception) {
- $io->writeError(\sprintf(
- '%s',
- $exception->getMessage()
- ));
-
- return 1;
- }
+ $composer = $this->factory->createComposer(
+ $io,
+ $composerFile
+ );
if (false === $input->getOption('dry-run') && !\is_writable($composerFile)) {
$io->writeError(\sprintf(
@@ -159,19 +151,22 @@ protected function execute(Console\Input\InputInterface $input, Console\Output\O
try {
$normalized = $this->normalizer->normalize($json);
- } catch (Normalizer\Exception\OriginalInvalidAccordingToSchemaException | Normalizer\Exception\NormalizedInvalidAccordingToSchemaException $exception) {
- $io->writeError(\sprintf(
- '%s',
- $exception->getMessage()
- ));
+ } catch (Normalizer\Exception\OriginalInvalidAccordingToSchemaException $exception) {
+ $io->writeError('Original composer.json does not match the expected JSON schema:');
- $errors = $exception->errors();
+ $this->showValidationErrors(
+ $io,
+ ...$exception->errors()
+ );
- \array_walk($errors, static function (string $error) use ($io): void {
- $io->writeError($error);
- });
+ return 1;
+ } catch (Normalizer\Exception\NormalizedInvalidAccordingToSchemaException $exception) {
+ $io->writeError('Normalized composer.json does not match the expected JSON schema:');
- $io->writeError('See https://getcomposer.org/doc/04-schema.md for details on the schema');
+ $this->showValidationErrors(
+ $io,
+ ...$exception->errors()
+ );
return 1;
} catch (\RuntimeException $exception) {
@@ -309,6 +304,18 @@ private function indentFrom(Console\Input\InputInterface $input): ?Normalizer\Fo
return $indent;
}
+ private function showValidationErrors(IO\IOInterface $io, string ...$errors): void
+ {
+ foreach ($errors as $error) {
+ $io->writeError(\sprintf(
+ '- %s',
+ $error
+ ));
+ }
+
+ $io->writeError('See https://getcomposer.org/doc/04-schema.md for details on the schema');
+ }
+
/**
* @param string $before
* @param string $after
diff --git a/src/NormalizePlugin.php b/src/NormalizePlugin.php
index fe4f0fbe..ef8e37a4 100644
--- a/src/NormalizePlugin.php
+++ b/src/NormalizePlugin.php
@@ -49,7 +49,7 @@ public function getCommands(): array
new Factory(),
new Normalizer\Vendor\Composer\ComposerJsonNormalizer(\sprintf(
'file://%s',
- \realpath(__DIR__ . '/../resource/schema.json')
+ \realpath(__DIR__ . '/../resource/schema-lax.json')
)),
new Normalizer\Format\Formatter(new Printer\Printer()),
new Diff\Differ(new Diff\Output\StrictUnifiedDiffOutputBuilder([
diff --git a/test/Fixture/json/not-valid/composer.json b/test/Fixture/json/not-valid/composer.json
index e8ef0dd9..bef04449 100644
--- a/test/Fixture/json/not-valid/composer.json
+++ b/test/Fixture/json/not-valid/composer.json
@@ -1,3 +1,7 @@
{
- "description": "This composer.json is not valid as it is missing required fields."
+ "_comment": "This composer.json is not valid according to a lax validation, as existing fields have unexpected types",
+ "name": [
+ "foo",
+ "bar"
+ ]
}
diff --git a/test/Fixture/json/valid/lock/not-present/json/already-normalized/composer.json b/test/Fixture/json/valid/lock/not-present/json/already-normalized/composer.json
index d479c5c5..7560419a 100644
--- a/test/Fixture/json/valid/lock/not-present/json/already-normalized/composer.json
+++ b/test/Fixture/json/valid/lock/not-present/json/already-normalized/composer.json
@@ -1,7 +1,5 @@
{
- "name": "foo/bar",
"type": "library",
- "description": "This composer.json is valid, a composer.lock is not present, and composer.json is already normalized.",
"keywords": [
"foo",
"bar"
@@ -16,5 +14,6 @@
"require": {
"php": "^7.1",
"ext-json": "*"
- }
+ },
+ "_comment": "This composer.json is valid according to a lax validation, a composer.lock is not present, and composer.json is already normalized."
}
diff --git a/test/Fixture/json/valid/lock/not-present/json/not-yet-normalized/composer.json b/test/Fixture/json/valid/lock/not-present/json/not-yet-normalized/composer.json
index 4575c845..dc07d390 100644
--- a/test/Fixture/json/valid/lock/not-present/json/not-yet-normalized/composer.json
+++ b/test/Fixture/json/valid/lock/not-present/json/not-yet-normalized/composer.json
@@ -1,7 +1,6 @@
{
- "name": "foo/bar",
"type": "library",
- "description": "This composer.json is valid, a composer.lock is not present, and composer.json is not yet normalized.",
+ "_comment": "This composer.json is valid according to a lax validation, , a composer.lock is not present, and composer.json is not yet normalized.",
"keywords": ["foo", "bar"],
"license": "MIT",
"authors": [
diff --git a/test/Fixture/json/valid/lock/present/lock/fresh-before/json/already-normalized/composer.json b/test/Fixture/json/valid/lock/present/lock/fresh-before/json/already-normalized/composer.json
index ab2f3a8a..eb5a823e 100644
--- a/test/Fixture/json/valid/lock/present/lock/fresh-before/json/already-normalized/composer.json
+++ b/test/Fixture/json/valid/lock/present/lock/fresh-before/json/already-normalized/composer.json
@@ -1,7 +1,5 @@
{
- "name": "foo/bar",
"type": "library",
- "description": "This composer.json is valid, a composer.lock is present and fresh before invoking the command, and composer.json is already normalized.",
"keywords": [
"foo",
"bar"
@@ -16,5 +14,6 @@
"require": {
"php": "^7.1",
"ext-json": "*"
- }
+ },
+ "_comment": "This composer.json is valid according to a lax validation, a composer.lock is present and fresh before invoking the command, and composer.json is already normalized."
}
diff --git a/test/Fixture/json/valid/lock/present/lock/fresh-before/json/already-normalized/composer.lock b/test/Fixture/json/valid/lock/present/lock/fresh-before/json/already-normalized/composer.lock
index 0c2504b4..58f2dcc8 100644
--- a/test/Fixture/json/valid/lock/present/lock/fresh-before/json/already-normalized/composer.lock
+++ b/test/Fixture/json/valid/lock/present/lock/fresh-before/json/already-normalized/composer.lock
@@ -4,7 +4,7 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically"
],
- "content-hash": "e02bb041c58876f82f19080ccf708473",
+ "content-hash": "5216eeb5774e4f66ebbf3db25aa2f951",
"packages": [],
"packages-dev": [],
"aliases": [],
diff --git a/test/Fixture/json/valid/lock/present/lock/fresh-before/json/not-yet-normalized/lock/fresh-after/composer.json b/test/Fixture/json/valid/lock/present/lock/fresh-before/json/not-yet-normalized/lock/fresh-after/composer.json
index 4e6885bb..973a37d7 100644
--- a/test/Fixture/json/valid/lock/present/lock/fresh-before/json/not-yet-normalized/lock/fresh-after/composer.json
+++ b/test/Fixture/json/valid/lock/present/lock/fresh-before/json/not-yet-normalized/lock/fresh-after/composer.json
@@ -1,7 +1,6 @@
{
"name": "foo/bar",
"type": "library",
- "description": "This composer.json is valid, a composer.lock is present and fresh before invoking the command, composer.json is not yet normalized, and composer.lock is still fresh after invoking the command.",
"keywords": ["foo", "bar"],
"license": "MIT",
"authors": [
@@ -10,5 +9,6 @@
"require": {
"php": "^7.1",
"ext-json": "*"
- }
+ },
+ "_comment": "This composer.json is valid according to a lax validation, a composer.lock is present and fresh before invoking the command, composer.json is not yet normalized, and composer.lock is still fresh after invoking the command."
}
diff --git a/test/Fixture/json/valid/lock/present/lock/fresh-before/json/not-yet-normalized/lock/not-fresh-after/composer.json b/test/Fixture/json/valid/lock/present/lock/fresh-before/json/not-yet-normalized/lock/not-fresh-after/composer.json
index b314cfa4..c45f57d9 100644
--- a/test/Fixture/json/valid/lock/present/lock/fresh-before/json/not-yet-normalized/lock/not-fresh-after/composer.json
+++ b/test/Fixture/json/valid/lock/present/lock/fresh-before/json/not-yet-normalized/lock/not-fresh-after/composer.json
@@ -1,7 +1,6 @@
{
"name": "foo/bar",
"type": "library",
- "description": "This composer.json is valid, a composer.lock is present and fresh before invoking the command, composer.json is not yet normalized, and composer.lock is not fresh after invoking the command.",
"keywords": ["foo", "bar"],
"license": "MIT",
"authors": [
@@ -10,5 +9,6 @@
"require": {
"ext-json": "*",
"php": "^7.1"
- }
+ },
+ "_comment": "This composer.json is valid according to a lax validation, , a composer.lock is present and fresh before invoking the command, composer.json is not yet normalized, and composer.lock is not fresh after invoking the command."
}
diff --git a/test/Fixture/json/valid/lock/present/lock/not-fresh-before/composer.json b/test/Fixture/json/valid/lock/present/lock/not-fresh-before/composer.json
index dabfddbb..a8904658 100644
--- a/test/Fixture/json/valid/lock/present/lock/not-fresh-before/composer.json
+++ b/test/Fixture/json/valid/lock/present/lock/not-fresh-before/composer.json
@@ -1,7 +1,6 @@
{
- "name": "foo/bar",
"type": "library",
- "description": "This composer.json is valid, a composer.lock is present, but not fresh before invoking the command.",
+ "_comment": "This composer.json is valid according to a lax validation, a composer.lock is present, but not fresh before invoking the command.",
"keywords": [
"foo",
"bar"
diff --git a/test/Integration/Command/NormalizeCommandTest.php b/test/Integration/Command/NormalizeCommandTest.php
index 25f83ca6..ebaba244 100644
--- a/test/Integration/Command/NormalizeCommandTest.php
+++ b/test/Integration/Command/NormalizeCommandTest.php
@@ -219,7 +219,7 @@ public function testFailsWhenIndentSizeIsInvalid(CommandInvocation $commandInvoc
*
* @param CommandInvocation $commandInvocation
*/
- public function testFailsWhenComposerJsonIsPresentButNotValid(CommandInvocation $commandInvocation): void
+ public function testFailsWhenComposerJsonIsPresentButNotValidAccordingToLaxValidation(CommandInvocation $commandInvocation): void
{
$scenario = self::createScenario(
$commandInvocation,
@@ -243,17 +243,7 @@ public function testFailsWhenComposerJsonIsPresentButNotValid(CommandInvocation
);
self::assertExitCodeSame(1, $exitCode);
-
- $display = $output->fetch();
-
- $message = \sprintf(
- 'Original JSON is not valid according to schema "file://%s".',
- \realpath(__DIR__ . '/../../../resource/schema.json')
- );
-
- self::assertContains($message, $display);
- self::assertContains('The property name is required', $display);
- self::assertContains('See https://getcomposer.org/doc/04-schema.md for details on the schema', $display);
+ self::assertContains('does not match the expected JSON schema', $output->fetch());
self::assertEquals($initialState, $scenario->currentState());
}
@@ -262,7 +252,7 @@ public function testFailsWhenComposerJsonIsPresentButNotValid(CommandInvocation
*
* @param CommandInvocation $commandInvocation
*/
- public function testFailsWhenComposerJsonIsPresentAndValidAndComposerLockIsNotPresentAndRuntimeExceptionIsThrownDuringNormalization(CommandInvocation $commandInvocation): void
+ public function testFailsWhenComposerJsonIsPresentAndValidAccordingToLaxValidationAndComposerLockIsNotPresentAndRuntimeExceptionIsThrownDuringNormalization(CommandInvocation $commandInvocation): void
{
$scenario = self::createScenario(
$commandInvocation,
@@ -320,7 +310,7 @@ public function normalize(Json $json): Json
*
* @param CommandInvocation $commandInvocation
*/
- public function testSucceedsWhenComposerJsonIsPresentAndValidAndComposerLockIsNotPresentAndComposerJsonIsAlreadyNormalized(CommandInvocation $commandInvocation): void
+ public function testSucceedsWhenComposerJsonIsPresentAndValidAccordingToLaxValidationAndComposerLockIsNotPresentAndComposerJsonIsAlreadyNormalized(CommandInvocation $commandInvocation): void
{
$scenario = self::createScenario(
$commandInvocation,
@@ -359,7 +349,7 @@ public function testSucceedsWhenComposerJsonIsPresentAndValidAndComposerLockIsNo
*
* @param CommandInvocation $commandInvocation
*/
- public function testSucceedsWhenComposerJsonIsPresentAndValidAndComposerLockIsNotPresentAndComposerJsonIsNotYetNormalized(CommandInvocation $commandInvocation): void
+ public function testSucceedsWhenComposerJsonIsPresentAndValidAccordingToLaxValidationAndComposerLockIsNotPresentAndComposerJsonIsNotYetNormalized(CommandInvocation $commandInvocation): void
{
$scenario = self::createScenario(
$commandInvocation,
@@ -402,7 +392,7 @@ public function testSucceedsWhenComposerJsonIsPresentAndValidAndComposerLockIsNo
*
* @param CommandInvocation $commandInvocation
*/
- public function testSucceedsWhenComposerJsonIsPresentAndValidAndComposerLockIsNotPresentAndComposerJsonIsNotYetNormalizedAndDiffOptionIsUsed(CommandInvocation $commandInvocation): void
+ public function testSucceedsWhenComposerJsonIsPresentAndValidAccordingToLaxValidationAndComposerLockIsNotPresentAndComposerJsonIsNotYetNormalizedAndDiffOptionIsUsed(CommandInvocation $commandInvocation): void
{
$scenario = self::createScenario(
$commandInvocation,
@@ -453,7 +443,7 @@ public function testSucceedsWhenComposerJsonIsPresentAndValidAndComposerLockIsNo
*
* @param CommandInvocation $commandInvocation
*/
- public function testFailsWhenComposerJsonIsPresentAndValidAndComposerLockIsNotPresentAndComposerJsonIsNotYetNormalizedAndDryRunOptionIsUsed(CommandInvocation $commandInvocation): void
+ public function testFailsWhenComposerJsonIsPresentAndValidAccordingToLaxValidationAndComposerLockIsNotPresentAndComposerJsonIsNotYetNormalizedAndDryRunOptionIsUsed(CommandInvocation $commandInvocation): void
{
$scenario = self::createScenario(
$commandInvocation,
@@ -502,7 +492,7 @@ public function testFailsWhenComposerJsonIsPresentAndValidAndComposerLockIsNotPr
* @param int $indentSize
* @param string $indentStyle
*/
- public function testSucceedsWhenComposerJsonIsPresentAndValidAndComposerLockIsNotPresentAndComposerJsonIsNotYetNormalizedAndIndentSizeAndIndentStyleOptionsAreUsed(
+ public function testSucceedsWhenComposerJsonIsPresentAndValidAccordingToLaxValidationAndComposerLockIsNotPresentAndComposerJsonIsNotYetNormalizedAndIndentSizeAndIndentStyleOptionsAreUsed(
CommandInvocation $commandInvocation,
int $indentSize,
string $indentStyle
@@ -551,7 +541,7 @@ public function testSucceedsWhenComposerJsonIsPresentAndValidAndComposerLockIsNo
*
* @param CommandInvocation $commandInvocation
*/
- public function testSucceedsWhenComposerJsonIsPresentAndValidAndComposerLockIsNotPresentAndComposerJsonIsNotYetNormalizedAndNoUpdateLockOptionIsUsed(CommandInvocation $commandInvocation): void
+ public function testSucceedsWhenComposerJsonIsPresentAndValidAccordingToLaxValidationAndComposerLockIsNotPresentAndComposerJsonIsNotYetNormalizedAndNoUpdateLockOptionIsUsed(CommandInvocation $commandInvocation): void
{
$scenario = self::createScenario(
$commandInvocation,
@@ -596,7 +586,7 @@ public function testSucceedsWhenComposerJsonIsPresentAndValidAndComposerLockIsNo
*
* @param CommandInvocation $commandInvocation
*/
- public function testFailsWhenComposerJsonIsPresentAndValidAndComposerLockIsPresentButNotFreshBefore(CommandInvocation $commandInvocation): void
+ public function testFailsWhenComposerJsonIsPresentAndValidAccordingToLaxValidationAndComposerLockIsPresentButNotFreshBefore(CommandInvocation $commandInvocation): void
{
$scenario = self::createScenario(
$commandInvocation,
@@ -630,7 +620,7 @@ public function testFailsWhenComposerJsonIsPresentAndValidAndComposerLockIsPrese
*
* @param CommandInvocation $commandInvocation
*/
- public function testSucceedsWhenComposerJsonIsPresentAndValidAndComposerLockIsPresentAndFreshBeforeAndComposerJsonIsAlreadyNormalized(CommandInvocation $commandInvocation): void
+ public function testSucceedsWhenComposerJsonIsPresentAndValidAccordingToLaxValidationAndComposerLockIsPresentAndFreshBeforeAndComposerJsonIsAlreadyNormalized(CommandInvocation $commandInvocation): void
{
$scenario = self::createScenario(
$commandInvocation,
@@ -670,7 +660,7 @@ public function testSucceedsWhenComposerJsonIsPresentAndValidAndComposerLockIsPr
*
* @param CommandInvocation $commandInvocation
*/
- public function testSucceedsWhenComposerJsonIsPresentAndValidAndComposerLockIsPresentAndFreshBeforeAndComposerJsonIsNotYetNormalizedAndComposerLockIsFreshAfter(CommandInvocation $commandInvocation): void
+ public function testSucceedsWhenComposerJsonIsPresentAndValidAccordingToLaxValidationAndComposerLockIsPresentAndFreshBeforeAndComposerJsonIsNotYetNormalizedAndComposerLockIsFreshAfter(CommandInvocation $commandInvocation): void
{
$scenario = self::createScenario(
$commandInvocation,
@@ -714,7 +704,7 @@ public function testSucceedsWhenComposerJsonIsPresentAndValidAndComposerLockIsPr
*
* @param CommandInvocation $commandInvocation
*/
- public function testSucceedsWhenComposerJsonIsPresentAndValidAndComposerLockIsPresentAndFreshBeforeAndComposerJsonIsNotYetNormalizedAndComposerLockIsNotFreshAfter(CommandInvocation $commandInvocation): void
+ public function testSucceedsWhenComposerJsonIsPresentAndValidAccordingToLaxValidationAndComposerLockIsPresentAndFreshBeforeAndComposerJsonIsNotYetNormalizedAndComposerLockIsNotFreshAfter(CommandInvocation $commandInvocation): void
{
$scenario = self::createScenario(
$commandInvocation,
@@ -759,7 +749,7 @@ public function testSucceedsWhenComposerJsonIsPresentAndValidAndComposerLockIsPr
*
* @param CommandInvocation $commandInvocation
*/
- public function testFailsWhenComposerJsonIsPresentAndValidAndComposerLockIsPresentAndFreshBeforeAndComposerJsonIsNotYetNormalizedAndDryRunOptionIsUsed(CommandInvocation $commandInvocation): void
+ public function testFailsWhenComposerJsonIsPresentAndValidAccordingToLaxValidationAndComposerLockIsPresentAndFreshBeforeAndComposerJsonIsNotYetNormalizedAndDryRunOptionIsUsed(CommandInvocation $commandInvocation): void
{
$scenario = self::createScenario(
$commandInvocation,
@@ -804,7 +794,7 @@ public function testFailsWhenComposerJsonIsPresentAndValidAndComposerLockIsPrese
*
* @param CommandInvocation $commandInvocation
*/
- public function testSucceedsWhenComposerJsonIsPresentAndValidAndComposerLockIsPresentAndFreshBeforeAndComposerJsonIsNotYetNormalizedAndNoUpdateLockOptionIsUsed(CommandInvocation $commandInvocation): void
+ public function testSucceedsWhenComposerJsonIsPresentAndValidAccordingToLaxValidationAndComposerLockIsPresentAndFreshBeforeAndComposerJsonIsNotYetNormalizedAndNoUpdateLockOptionIsUsed(CommandInvocation $commandInvocation): void
{
$scenario = self::createScenario(
$commandInvocation,
@@ -1156,6 +1146,7 @@ private static function validateComposer(State $state): int
return $application->run(
new Console\Input\ArrayInput([
'command' => 'validate',
+ '--no-check-publish' => true,
'--working-dir' => $state->directory()->path(),
]),
new Console\Output\BufferedOutput()