From e348adbee46b9d3a70c645932046294e72707a4c Mon Sep 17 00:00:00 2001 From: Johannes Haseitl Date: Fri, 3 Feb 2017 12:21:16 +0100 Subject: [PATCH 1/3] #12 Add test for deprecation notice --- tests/FixturesTest.php | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/tests/FixturesTest.php b/tests/FixturesTest.php index 2c45f6a..fe1f69d 100644 --- a/tests/FixturesTest.php +++ b/tests/FixturesTest.php @@ -58,7 +58,10 @@ public function testFixtures($folder, $commands = array(), $files = array()) // the latest code. $this->composer('config', 'repositories.dev', 'path', $this->projectRoot); - $this->composer('install'); + $output = $this->composer('install'); + + // Check for deprecation notices. + $this->assertDeprecationNotice($output); // Run additional composer commands. foreach ($commands as $command) { @@ -123,4 +126,15 @@ protected function composer($command) return $output; } + + /** + * Check lines for not having any deprecation notice. + * @param string[] $lines + */ + protected function assertDeprecationNotice($lines) + { + foreach ($lines as $line) { + $this->assertNotContains('Deprecation Notice:', $line); + } + } } From 12124bdc805e17fee0eee2c21cfc4363c50d09ac Mon Sep 17 00:00:00 2001 From: Nick Wilde Date: Sun, 13 Nov 2016 19:24:53 -0800 Subject: [PATCH 2/3] Fix deprecated class usage As noted in: https://github.com/composer/composer/releases/tag/1.0.0-alpha10 (April 2015), \Composer\Installer\PackageEvent should be used instead of \Composer\Script\PackageEvent --- src/Plugin.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Plugin.php b/src/Plugin.php index 9a3979d..d272f6b 100644 --- a/src/Plugin.php +++ b/src/Plugin.php @@ -14,7 +14,7 @@ use Composer\EventDispatcher\EventSubscriberInterface; use Composer\IO\IOInterface; use Composer\Plugin\PluginInterface; -use Composer\Script\PackageEvent; +use Composer\Installer\PackageEvent; use Composer\Script\ScriptEvents; use Composer\Util\Filesystem; @@ -55,7 +55,7 @@ public static function getSubscribedEvents() /** * Pre Package event behaviour for backing up preserved paths. * - * @param \Composer\Script\PackageEvent $event + * @param \Composer\Installer\PackageEvent $event */ public function prePackage(PackageEvent $event) { @@ -66,7 +66,7 @@ public function prePackage(PackageEvent $event) /** * Pre Package event behaviour for backing up preserved paths. * - * @param \Composer\Script\PackageEvent $event + * @param \Composer\Installer\PackageEvent $event */ public function postPackage(PackageEvent $event) { From 0008aa285adddc7338a3111038a9cb49fdc3da14 Mon Sep 17 00:00:00 2001 From: Demin Yin Date: Sat, 14 Jan 2017 20:25:41 -0800 Subject: [PATCH 3/3] fix deprecated class usage in class \derhasi\Composer\PluginWrapper --- src/PluginWrapper.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/PluginWrapper.php b/src/PluginWrapper.php index eab7557..4f43deb 100644 --- a/src/PluginWrapper.php +++ b/src/PluginWrapper.php @@ -14,7 +14,7 @@ use Composer\EventDispatcher\EventSubscriberInterface; use Composer\IO\IOInterface; use Composer\Plugin\PluginInterface; -use Composer\Script\PackageEvent; +use Composer\Installer\PackageEvent; use Composer\Script\ScriptEvents; use Composer\Util\Filesystem; @@ -57,7 +57,7 @@ public function __construct(Composer $composer, IOInterface $io) /** * Pre Package event behaviour for backing up preserved paths. * - * @param \Composer\Script\PackageEvent $event + * @param \Composer\Installer\PackageEvent $event */ public function prePackage(PackageEvent $event) { @@ -82,7 +82,7 @@ public function prePackage(PackageEvent $event) /** * Pre Package event behaviour for backing up preserved paths. * - * @param \Composer\Script\PackageEvent $event + * @param \Composer\Installer\PackageEvent $event */ public function postPackage(PackageEvent $event) { @@ -100,7 +100,7 @@ public function postPackage(PackageEvent $event) * In the case of update, the target package is retrieved, as that will * provide the path the package will be installed to. * - * @param \Composer\Script\PackageEvent $event + * @param \Composer\Installer\PackageEvent $event * @return \Composer\Package\PackageInterface[] * @throws \Exception */