Skip to content

Commit 2d11b2a

Browse files
Merge pull request #74 from stof/fix_specs
Fix the specs to pass
2 parents 8047bcd + 89cfb7f commit 2d11b2a

File tree

1 file changed

+14
-6
lines changed

1 file changed

+14
-6
lines changed

spec/Packagist/Api/ClientSpec.php

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -102,13 +102,17 @@ public function it_gets_composer_package_details(HttpClient $client, Factory $fa
102102
$response->getBody()->shouldBeCalled()->willReturn($body);
103103
$body->getContents()->shouldBeCalled()->willReturn($data);
104104

105-
$client->request('GET', 'https://packagist.org/p/sylius/sylius.json')
105+
$client->request('GET', 'https://packagist.org/p2/sylius/sylius~dev.json')
106106
->shouldBeCalled()
107107
->willReturn($response);
108108

109-
$factory->create(json_decode($data, true))->shouldBeCalled();
109+
$packages = [
110+
'1.0.0' => ['name' => 'sylius/sylius', 'version' => '1.0.0']
111+
];
112+
113+
$factory->create(json_decode($data, true))->shouldBeCalled()->willReturn($packages);
110114

111-
$this->getComposer('sylius/sylius');
115+
$this->getComposer('sylius/sylius')->shouldBe($packages);
112116
}
113117

114118
public function it_gets_composer_lite_package_details(HttpClient $client, Factory $factory, Response $response, Stream $body): void
@@ -117,13 +121,17 @@ public function it_gets_composer_lite_package_details(HttpClient $client, Factor
117121
$response->getBody()->shouldBeCalled()->willReturn($body);
118122
$body->getContents()->shouldBeCalled()->willReturn($data);
119123

120-
$client->request('GET', 'https://packagist.org/p/sylius/sylius.json')
124+
$client->request('GET', 'https://packagist.org/p2/sylius/sylius.json')
121125
->shouldBeCalled()
122126
->willReturn($response);
123127

124-
$factory->create(json_decode($data, true))->shouldBeCalled();
128+
$packages = [
129+
'1.0.0' => ['name' => 'sylius/sylius', 'version' => '1.0.0']
130+
];
131+
132+
$factory->create(json_decode($data, true))->shouldBeCalled()->willReturn($packages);
125133

126-
$this->getComposerLite('sylius/sylius');
134+
$this->getComposerLite('sylius/sylius')->shouldBe($packages);
127135
}
128136

129137
public function it_lists_all_package_names(HttpClient $client, Factory $factory, Response $response, Stream $body): void

0 commit comments

Comments
 (0)