Skip to content

Commit

Permalink
Merge f8fe2f6 into 2ee4baa
Browse files Browse the repository at this point in the history
  • Loading branch information
eiriksm committed Feb 27, 2021
2 parents 2ee4baa + f8fe2f6 commit 73cc2ff
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/CosyComposer.php
Original file line number Diff line number Diff line change
Expand Up @@ -740,6 +740,10 @@ public function run()
if (!isset($item->latest) || !isset($item->{'latest-status'})) {
unset($data[$delta]);
}
// If a package is abandoned, we do not really want to know. Since we can't update it anyway.
if ($item->latest === $item->version || $item->{'latest-status'} === 'up-to-date') {
unset($data[$delta]);
}
}
if (empty($data)) {
$this->log('No updates found');
Expand Down
28 changes: 28 additions & 0 deletions test/integration/issues/Issue200Test.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<?php

namespace eiriksm\CosyComposerTest\integration\issues;

use eiriksm\CosyComposer\CosyComposer;
use eiriksm\CosyComposerTest\integration\ComposerUpdateIntegrationBase;

/**
* Test for issue 200.
*/
class Issue200Test extends ComposerUpdateIntegrationBase
{
protected $packageForUpdateOutput = 'fzaninotto/faker';
protected $packageVersionForFromUpdateOutput = 'v1.9.2';
protected $packageVersionForToUpdateOutput = 'v.1.9.2';
protected $composerAssetFiles = 'composer164';

protected function createUpdateJsonFromData($package, $version, $new_version)
{
return sprintf('{"installed": [{"name": "%s", "version": "%s", "latest": "%s", "latest-status": "up-to-date"}]}', $package, $version, $new_version);
}

public function testRequireDevAdded()
{
$this->runtestExpectedOutput();
$this->assertOutputContainsMessage('No updates found', $this->cosy);
}
}

0 comments on commit 73cc2ff

Please sign in to comment.