From 6e0cb6cae0f6a6d3f6a73e595326b614bdd6b5f6 Mon Sep 17 00:00:00 2001 From: Jordi Boggiano Date: Wed, 11 Dec 2024 11:39:34 +0100 Subject: [PATCH] Fix tests --- src/Composer/Command/ValidateCommand.php | 2 +- tests/Composer/Test/Command/ValidateCommandTest.php | 6 +----- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/src/Composer/Command/ValidateCommand.php b/src/Composer/Command/ValidateCommand.php index 5730ff490..fb71081d4 100644 --- a/src/Composer/Command/ValidateCommand.php +++ b/src/Composer/Command/ValidateCommand.php @@ -146,7 +146,7 @@ EOT if (\count($errors) > 0) { $io->writeError('' . $name . ' is invalid, the following errors/warnings were found:'); - } elseif (\count($publishErrors) > 0) { + } elseif (\count($publishErrors) > 0 && $checkPublish) { $io->writeError('' . $name . ' is valid for simple usage with Composer but has'); $io->writeError('strict errors that make it unable to be published as a package'); $doPrintSchemaUrl = $printSchemaUrl; diff --git a/tests/Composer/Test/Command/ValidateCommandTest.php b/tests/Composer/Test/Command/ValidateCommandTest.php index bae0b261c..0c30687fd 100644 --- a/tests/Composer/Test/Command/ValidateCommandTest.php +++ b/tests/Composer/Test/Command/ValidateCommandTest.php @@ -142,14 +142,10 @@ OUTPUT $publishDataStripped, [ '--no-check-publish' => true], <<See https://getcomposer.org/doc/04-schema.md for details on the schema # General warnings - No license specified, it is recommended to do so. For closed-source software you may use "proprietary" as license. -# Publish warnings -- name : The property name is required -- description : The property description is required OUTPUT ]; }