From 44bb82b50f7d6920c43ea705ae94dbc6498176b0 Mon Sep 17 00:00:00 2001 From: Jordi Boggiano Date: Wed, 10 Mar 2021 14:34:26 +0100 Subject: [PATCH] Make full functional test output more reliable --- .../Test/Fixtures/functional/installed-versions/Hooks.php | 8 ++++---- .../functional/installed-versions/plugin-a/PluginA.php | 8 ++++---- .../functional/installed-versions/plugin-b/PluginB.php | 8 ++++---- .../functional/installed-versions2/plugin-a/PluginA.php | 8 ++++---- .../functional/installed-versions2/plugin-b/PluginB.php | 8 ++++---- 5 files changed, 20 insertions(+), 20 deletions(-) diff --git a/tests/Composer/Test/Fixtures/functional/installed-versions/Hooks.php b/tests/Composer/Test/Fixtures/functional/installed-versions/Hooks.php index b215d1e52..31faaae16 100644 --- a/tests/Composer/Test/Fixtures/functional/installed-versions/Hooks.php +++ b/tests/Composer/Test/Fixtures/functional/installed-versions/Hooks.php @@ -8,13 +8,13 @@ class Hooks { public static function preUpdate(Event $event) { - echo '!!PreUpdate:'.JsonFile::encode(InstalledVersions::getInstalledPackages(), 320)."\n"; - echo '!!Versions:console:'.InstalledVersions::getVersion('symfony/console').';process:'.InstalledVersions::getVersion('symfony/process').';filesystem:'.InstalledVersions::getVersion('symfony/filesystem')."\n"; + fwrite(STDERR, '!!PreUpdate:'.JsonFile::encode(InstalledVersions::getInstalledPackages(), 320)."\n"); + fwrite(STDERR, '!!Versions:console:'.InstalledVersions::getVersion('symfony/console').';process:'.InstalledVersions::getVersion('symfony/process').';filesystem:'.InstalledVersions::getVersion('symfony/filesystem')."\n"); } public static function postUpdate(Event $event) { - echo '!!PostUpdate:'.JsonFile::encode(InstalledVersions::getInstalledPackages(), 320)."\n"; - echo '!!Versions:console:'.InstalledVersions::getVersion('symfony/console').';process:'.InstalledVersions::getVersion('symfony/process').';filesystem:'.InstalledVersions::getVersion('symfony/filesystem')."\n"; + fwrite(STDERR, '!!PostUpdate:'.JsonFile::encode(InstalledVersions::getInstalledPackages(), 320)."\n"); + fwrite(STDERR, '!!Versions:console:'.InstalledVersions::getVersion('symfony/console').';process:'.InstalledVersions::getVersion('symfony/process').';filesystem:'.InstalledVersions::getVersion('symfony/filesystem')."\n"); } } diff --git a/tests/Composer/Test/Fixtures/functional/installed-versions/plugin-a/PluginA.php b/tests/Composer/Test/Fixtures/functional/installed-versions/plugin-a/PluginA.php index 224012c6f..8e40ac318 100644 --- a/tests/Composer/Test/Fixtures/functional/installed-versions/plugin-a/PluginA.php +++ b/tests/Composer/Test/Fixtures/functional/installed-versions/plugin-a/PluginA.php @@ -10,10 +10,10 @@ class PluginA implements PluginInterface { public function activate(Composer $composer, IOInterface $io) { - echo '!!PluginAInit'.JsonFile::encode(InstalledVersions::getInstalledPackages(), 320)."\n"; - echo '!!PluginA:'.(InstalledVersions::isInstalled('plugin/a') ? InstalledVersions::getVersion('plugin/a') : 'null')."\n"; - echo '!!PluginB:'.(InstalledVersions::isInstalled('plugin/b') ? InstalledVersions::getVersion('plugin/b') : 'null')."\n"; - echo '!!Versions:console:'.InstalledVersions::getVersion('symfony/console').';process:'.InstalledVersions::getVersion('symfony/process').';filesystem:'.InstalledVersions::getVersion('symfony/filesystem')."\n"; + fwrite(STDERR, '!!PluginAInit'.JsonFile::encode(InstalledVersions::getInstalledPackages(), 320)."\n"); + fwrite(STDERR, '!!PluginA:'.(InstalledVersions::isInstalled('plugin/a') ? InstalledVersions::getVersion('plugin/a') : 'null')."\n"); + fwrite(STDERR, '!!PluginB:'.(InstalledVersions::isInstalled('plugin/b') ? InstalledVersions::getVersion('plugin/b') : 'null')."\n"); + fwrite(STDERR, '!!Versions:console:'.InstalledVersions::getVersion('symfony/console').';process:'.InstalledVersions::getVersion('symfony/process').';filesystem:'.InstalledVersions::getVersion('symfony/filesystem')."\n"); } public function deactivate(Composer $composer, IOInterface $io) diff --git a/tests/Composer/Test/Fixtures/functional/installed-versions/plugin-b/PluginB.php b/tests/Composer/Test/Fixtures/functional/installed-versions/plugin-b/PluginB.php index 1315f52c5..65a8c81d8 100644 --- a/tests/Composer/Test/Fixtures/functional/installed-versions/plugin-b/PluginB.php +++ b/tests/Composer/Test/Fixtures/functional/installed-versions/plugin-b/PluginB.php @@ -10,10 +10,10 @@ class PluginB implements PluginInterface { public function activate(Composer $composer, IOInterface $io) { - echo '!!PluginBInit'.JsonFile::encode(InstalledVersions::getInstalledPackages(), 320)."\n"; - echo '!!PluginA:'.(InstalledVersions::isInstalled('plugin/a') ? InstalledVersions::getVersion('plugin/a') : 'null')."\n"; - echo '!!PluginB:'.(InstalledVersions::isInstalled('plugin/b') ? InstalledVersions::getVersion('plugin/b') : 'null')."\n"; - echo '!!Versions:console:'.InstalledVersions::getVersion('symfony/console').';process:'.InstalledVersions::getVersion('symfony/process').';filesystem:'.InstalledVersions::getVersion('symfony/filesystem')."\n"; + fwrite(STDERR, '!!PluginBInit'.JsonFile::encode(InstalledVersions::getInstalledPackages(), 320)."\n"); + fwrite(STDERR, '!!PluginA:'.(InstalledVersions::isInstalled('plugin/a') ? InstalledVersions::getVersion('plugin/a') : 'null')."\n"); + fwrite(STDERR, '!!PluginB:'.(InstalledVersions::isInstalled('plugin/b') ? InstalledVersions::getVersion('plugin/b') : 'null')."\n"); + fwrite(STDERR, '!!Versions:console:'.InstalledVersions::getVersion('symfony/console').';process:'.InstalledVersions::getVersion('symfony/process').';filesystem:'.InstalledVersions::getVersion('symfony/filesystem')."\n"); } public function deactivate(Composer $composer, IOInterface $io) diff --git a/tests/Composer/Test/Fixtures/functional/installed-versions2/plugin-a/PluginA.php b/tests/Composer/Test/Fixtures/functional/installed-versions2/plugin-a/PluginA.php index 224012c6f..8e40ac318 100644 --- a/tests/Composer/Test/Fixtures/functional/installed-versions2/plugin-a/PluginA.php +++ b/tests/Composer/Test/Fixtures/functional/installed-versions2/plugin-a/PluginA.php @@ -10,10 +10,10 @@ class PluginA implements PluginInterface { public function activate(Composer $composer, IOInterface $io) { - echo '!!PluginAInit'.JsonFile::encode(InstalledVersions::getInstalledPackages(), 320)."\n"; - echo '!!PluginA:'.(InstalledVersions::isInstalled('plugin/a') ? InstalledVersions::getVersion('plugin/a') : 'null')."\n"; - echo '!!PluginB:'.(InstalledVersions::isInstalled('plugin/b') ? InstalledVersions::getVersion('plugin/b') : 'null')."\n"; - echo '!!Versions:console:'.InstalledVersions::getVersion('symfony/console').';process:'.InstalledVersions::getVersion('symfony/process').';filesystem:'.InstalledVersions::getVersion('symfony/filesystem')."\n"; + fwrite(STDERR, '!!PluginAInit'.JsonFile::encode(InstalledVersions::getInstalledPackages(), 320)."\n"); + fwrite(STDERR, '!!PluginA:'.(InstalledVersions::isInstalled('plugin/a') ? InstalledVersions::getVersion('plugin/a') : 'null')."\n"); + fwrite(STDERR, '!!PluginB:'.(InstalledVersions::isInstalled('plugin/b') ? InstalledVersions::getVersion('plugin/b') : 'null')."\n"); + fwrite(STDERR, '!!Versions:console:'.InstalledVersions::getVersion('symfony/console').';process:'.InstalledVersions::getVersion('symfony/process').';filesystem:'.InstalledVersions::getVersion('symfony/filesystem')."\n"); } public function deactivate(Composer $composer, IOInterface $io) diff --git a/tests/Composer/Test/Fixtures/functional/installed-versions2/plugin-b/PluginB.php b/tests/Composer/Test/Fixtures/functional/installed-versions2/plugin-b/PluginB.php index 1315f52c5..65a8c81d8 100644 --- a/tests/Composer/Test/Fixtures/functional/installed-versions2/plugin-b/PluginB.php +++ b/tests/Composer/Test/Fixtures/functional/installed-versions2/plugin-b/PluginB.php @@ -10,10 +10,10 @@ class PluginB implements PluginInterface { public function activate(Composer $composer, IOInterface $io) { - echo '!!PluginBInit'.JsonFile::encode(InstalledVersions::getInstalledPackages(), 320)."\n"; - echo '!!PluginA:'.(InstalledVersions::isInstalled('plugin/a') ? InstalledVersions::getVersion('plugin/a') : 'null')."\n"; - echo '!!PluginB:'.(InstalledVersions::isInstalled('plugin/b') ? InstalledVersions::getVersion('plugin/b') : 'null')."\n"; - echo '!!Versions:console:'.InstalledVersions::getVersion('symfony/console').';process:'.InstalledVersions::getVersion('symfony/process').';filesystem:'.InstalledVersions::getVersion('symfony/filesystem')."\n"; + fwrite(STDERR, '!!PluginBInit'.JsonFile::encode(InstalledVersions::getInstalledPackages(), 320)."\n"); + fwrite(STDERR, '!!PluginA:'.(InstalledVersions::isInstalled('plugin/a') ? InstalledVersions::getVersion('plugin/a') : 'null')."\n"); + fwrite(STDERR, '!!PluginB:'.(InstalledVersions::isInstalled('plugin/b') ? InstalledVersions::getVersion('plugin/b') : 'null')."\n"); + fwrite(STDERR, '!!Versions:console:'.InstalledVersions::getVersion('symfony/console').';process:'.InstalledVersions::getVersion('symfony/process').';filesystem:'.InstalledVersions::getVersion('symfony/filesystem')."\n"); } public function deactivate(Composer $composer, IOInterface $io)