Skip to content

Commit 7213b6a

Browse files
committed
Changes ApiTest::loadFixture() to accept un-encoded fixture names.
1 parent 5fdfd89 commit 7213b6a

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

tests/unit-tests/ApiTest.php

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -285,15 +285,16 @@ final public function testApiShouldReturnMetadataForDirectoryWhenGivenPathIsDire
285285
'sha' => null,
286286
'path' => 'a-directory'
287287
]],
288-
'willReturn' => $this->loadFixture('repos%2Fpotherca-bot%2Ftest-repository%2Fcommits'),
288+
'willReturn' => $this->loadFixture('repos/potherca-bot/test-repository/commits'),
289289
],
290290
],
291291
GitData::class => [
292292
Trees::class => [
293293
'method' => 'show',
294294
'exactly' => 1,
295295
'with' => [self::MOCK_VENDOR, self::MOCK_PACKAGE, self::MOCK_REFERENCE],
296-
'willReturn' => $this->loadFixture('repos%2Fpotherca-bot%2Ftest-repository%2Fgit%2Ftrees%2FHEAD'),
296+
297+
'willReturn' => $this->loadFixture('repos/potherca-bot/test-repository/git/trees/HEAD'),
297298
],
298299
],
299300
]);
@@ -1002,6 +1003,8 @@ final public function provideExpectedMetadata()
10021003
*/
10031004
private function loadFixture($fixtureName)
10041005
{
1006+
$fixtureName = urlencode($fixtureName);
1007+
10051008
$fixtureDirectory = sprintf('%s/fixtures', dirname(__DIR__));
10061009
$fixturePath = sprintf('%s/%s.json', $fixtureDirectory, $fixtureName);
10071010

0 commit comments

Comments
 (0)