Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions infection.json.dist
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,12 @@
"ignore": [
"IonBazan\\ComposerDiff\\Formatter\\AbstractFormatter::terminalLink"
]
},
"ReturnRemoval": {
"ignore": [
"IonBazan\\ComposerDiff\\Formatter\\Helper\\Table::getColumnWidth",
"IonBazan\\ComposerDiff\\Command\\DiffCommand::hasDowngrades"
]
}
}
}
12 changes: 6 additions & 6 deletions src/Url/BitBucketGenerator.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,20 +31,20 @@ public function getCompareUrl(PackageInterface $initialPackage, PackageInterface
return sprintf(
'%s/branches/compare/%s%%0D%s',
$baseUrl,
$this->getCompareRef($initialPackage),
$this->getCompareRef($targetPackage)
$this->getCompareRef($targetPackage),
$this->getCompareRef($initialPackage)
);
}

return sprintf(
'%s/branches/compare/%s/%s:%s%%0D%s/%s:%s',
$baseUrl,
$baseUser,
$this->getRepo($initialPackage),
$this->getCompareRef($initialPackage),
$targetUser,
$this->getRepo($targetPackage),
$this->getCompareRef($targetPackage)
$this->getCompareRef($targetPackage),
$baseUser,
$this->getRepo($initialPackage),
$this->getCompareRef($initialPackage)
);
}

Expand Down
7 changes: 7 additions & 0 deletions tests/Diff/DiffEntryTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,13 @@ public function testCreateWithoutUrlGenerators()
$this->assertNull($entry->getProjectUrl());
}

public function testTypeForInvalidOperation()
{
$operation = $this->getMockBuilder('Composer\DependencyResolver\Operation\OperationInterface')->getMock();
$entry = new DiffEntry($operation);
$this->assertSame(DiffEntry::TYPE_CHANGE, $entry->getType());
}

public function operationUrlProvider()
{
return array(
Expand Down
12 changes: 6 additions & 6 deletions tests/Url/BitBucketGeneratorTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -64,32 +64,32 @@ public function compareUrlProvider()
'same maintainer' => array(
$this->getPackageWithSource('acme/package', '3.12.0', 'https://bitbucket.org/acme/package.git'),
$this->getPackageWithSource('acme/package', '3.12.1', 'https://bitbucket.org/acme/package.git'),
'https://bitbucket.org/acme/package/branches/compare/3.12.0%0D3.12.1',
'https://bitbucket.org/acme/package/branches/compare/3.12.1%0D3.12.0',
),
'without .git' => array(
$this->getPackageWithSource('acme/package', '3.12.0', 'https://bitbucket.org/acme/package'),
$this->getPackageWithSource('acme/package', '3.12.1', 'https://bitbucket.org/acme/package'),
'https://bitbucket.org/acme/package/branches/compare/3.12.0%0D3.12.1',
'https://bitbucket.org/acme/package/branches/compare/3.12.1%0D3.12.0',
),
'dev versions' => array(
$this->getPackageWithSource('acme/package', 'dev-master', 'https://bitbucket.org/acme/package.git', 'd46283075d76ed244f7825b378eeb1cee246af73'),
$this->getPackageWithSource('acme/package', 'dev-master', 'https://bitbucket.org/acme/package.git', '9b860214d58c48b5cbe99bdb17914d0eb723c9cd'),
'https://bitbucket.org/acme/package/branches/compare/d462830%0D9b86021',
'https://bitbucket.org/acme/package/branches/compare/9b86021%0Dd462830',
),
'invalid or short reference' => array(
$this->getPackageWithSource('acme/package', 'dev-master', 'https://bitbucket.org/acme/package.git', 'd462830'),
$this->getPackageWithSource('acme/package', 'dev-master', 'https://bitbucket.org/acme/package.git', '1'),
'https://bitbucket.org/acme/package/branches/compare/d462830%0D1',
'https://bitbucket.org/acme/package/branches/compare/1%0Dd462830',
),
'compare with base fork' => array(
$this->getPackageWithSource('acme/package', '3.12.0', 'https://bitbucket.org/IonBazan/package.git'),
$this->getPackageWithSource('acme/package', '3.12.1', 'https://bitbucket.org/acme/package.git'),
'https://bitbucket.org/acme/package/branches/compare/IonBazan/package:3.12.0%0Dacme/package:3.12.1',
'https://bitbucket.org/acme/package/branches/compare/acme/package:3.12.1%0DIonBazan/package:3.12.0',
),
'compare with head fork' => array(
$this->getPackageWithSource('acme/package', '3.12.0', 'https://bitbucket.org/acme/package.git'),
$this->getPackageWithSource('acme/package', '3.12.1', 'https://bitbucket.org/IonBazan/package.git'),
'https://bitbucket.org/IonBazan/package/branches/compare/acme/package:3.12.0%0DIonBazan/package:3.12.1',
'https://bitbucket.org/IonBazan/package/branches/compare/IonBazan/package:3.12.1%0Dacme/package:3.12.0',
),
'compare with different repository provider' => array(
$this->getPackageWithSource('acme/package', '3.12.0', 'https://bitbucket.org/acme/package.git'),
Expand Down