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) { 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 */ 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); + } + } }