-
Notifications
You must be signed in to change notification settings - Fork 107
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: composer v2 compatibility (#650)
* fix: composer v2 compatibility refs #649 * fix: typo refs #649 * fix: order of routes, strip ~dev suffix refs #649
- Loading branch information
Showing
2 changed files
with
61 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -207,14 +207,16 @@ public function testProviderV2Action(): void | |
|
||
self::assertMatchesPattern(' | ||
{ | ||
"buddy-works/repman": { | ||
"1.2.3": { | ||
"version": "1.2.3", | ||
"version_normalized": "1.2.3.0", | ||
"dist": { | ||
"type": "zip", | ||
"url": "/path/to/reference.zip", | ||
"reference": "ac7dcaf888af2324cd14200769362129c8dd8550" | ||
"packages": { | ||
"buddy-works/repman": { | ||
"1.2.3": { | ||
"version": "1.2.3", | ||
"version_normalized": "1.2.3.0", | ||
"dist": { | ||
"type": "zip", | ||
"url": "/path/to/reference.zip", | ||
"reference": "ac7dcaf888af2324cd14200769362129c8dd8550" | ||
} | ||
} | ||
} | ||
} | ||
|
@@ -254,4 +256,36 @@ public function testProviderV2ForMissingPackage(): void | |
|
||
self::assertTrue($this->client->getResponse()->isNotFound()); | ||
} | ||
|
||
public function testProviderV2DevAction(): void | ||
{ | ||
$adminId = $this->createAndLoginAdmin('[email protected]', 'secret'); | ||
$this->fixtures->createToken($this->fixtures->createOrganization('buddy', $adminId), 'secret-org-token'); | ||
|
||
$this->client->request('GET', '/p2/buddy-works/repman~dev.json', [], [], [ | ||
'HTTP_HOST' => 'buddy.repo.repman.wip', | ||
'PHP_AUTH_USER' => 'token', | ||
'PHP_AUTH_PW' => 'secret-org-token', | ||
]); | ||
|
||
self::assertTrue($this->client->getResponse()->isOk()); | ||
|
||
self::assertMatchesPattern(' | ||
{ | ||
"packages": { | ||
"buddy-works/repman": { | ||
"1.2.3": { | ||
"version": "1.2.3", | ||
"version_normalized": "1.2.3.0", | ||
"dist": { | ||
"type": "zip", | ||
"url": "/path/to/reference.zip", | ||
"reference": "ac7dcaf888af2324cd14200769362129c8dd8550" | ||
} | ||
} | ||
} | ||
} | ||
} | ||
', $this->client->getResponse()->getContent()); | ||
} | ||
} |