Skip to content

Commit

Permalink
Fix the specs to pass
Browse files Browse the repository at this point in the history
  • Loading branch information
stof committed Jan 20, 2022
1 parent 8047bcd commit 89cfb7f
Showing 1 changed file with 14 additions and 6 deletions.
20 changes: 14 additions & 6 deletions spec/Packagist/Api/ClientSpec.php
Expand Up @@ -102,13 +102,17 @@ public function it_gets_composer_package_details(HttpClient $client, Factory $fa
$response->getBody()->shouldBeCalled()->willReturn($body);
$body->getContents()->shouldBeCalled()->willReturn($data);

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

$factory->create(json_decode($data, true))->shouldBeCalled();
$packages = [
'1.0.0' => ['name' => 'sylius/sylius', 'version' => '1.0.0']
];

$factory->create(json_decode($data, true))->shouldBeCalled()->willReturn($packages);

$this->getComposer('sylius/sylius');
$this->getComposer('sylius/sylius')->shouldBe($packages);
}

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

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

$factory->create(json_decode($data, true))->shouldBeCalled();
$packages = [
'1.0.0' => ['name' => 'sylius/sylius', 'version' => '1.0.0']
];

$factory->create(json_decode($data, true))->shouldBeCalled()->willReturn($packages);

$this->getComposerLite('sylius/sylius');
$this->getComposerLite('sylius/sylius')->shouldBe($packages);
}

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

0 comments on commit 89cfb7f

Please sign in to comment.