Skip to content

Commit

Permalink
Merge pull request #17 from derhasi/12-deprecation-notice
Browse files Browse the repository at this point in the history
Fix deprecation notice
  • Loading branch information
derhasi authored Feb 3, 2017
2 parents 351d9e4 + 0008aa2 commit d557250
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 8 deletions.
6 changes: 3 additions & 3 deletions src/Plugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -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)
{
Expand All @@ -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)
{
Expand Down
8 changes: 4 additions & 4 deletions src/PluginWrapper.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -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)
{
Expand All @@ -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)
{
Expand All @@ -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
*/
Expand Down
16 changes: 15 additions & 1 deletion tests/FixturesTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down Expand Up @@ -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);
}
}
}

0 comments on commit d557250

Please sign in to comment.