Skip to content

Commit

Permalink
Fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
GrahamCampbell committed Nov 28, 2020
1 parent 4d4067a commit 9f4259e
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Simple object oriented wrapper for Packagist API.

## Requirements

* PHP ^7.1
* PHP `^7.1 || ^8.0`

## Installation

Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
}
],
"require": {
"php": ">=7.1",
"php": "^7.1 || ^8.0",
"guzzlehttp/guzzle": "^6.0 || ^7.0",
"doctrine/inflector": "^1.0 || ^2.0"
},
Expand Down
16 changes: 8 additions & 8 deletions spec/Packagist/Api/ClientSpec.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ function it_search_for_packages(HttpClient $client, Factory $factory, Response $
$data = file_get_contents('spec/Packagist/Api/Fixture/search.json');
$response->getBody()->shouldBeCalled()->willReturn($data);

$client->request('get', 'https://packagist.org/search.json?q=sylius')->shouldBeCalled()->willReturn($response);
$client->request('GET', 'https://packagist.org/search.json?q=sylius')->shouldBeCalled()->willReturn($response);
$factory->create(json_decode($data, true))->shouldBeCalled()->willReturn(array());

$this->search('sylius');
Expand All @@ -39,7 +39,7 @@ function it_search_for_packages_with_limit(HttpClient $client, Factory $factory,
$data = file_get_contents('spec/Packagist/Api/Fixture/search.json');
$response->getBody()->shouldBeCalled()->willReturn($data);

$client->request('get', 'https://packagist.org/search.json?q=sylius')->shouldBeCalled()->willReturn($response);
$client->request('GET', 'https://packagist.org/search.json?q=sylius')->shouldBeCalled()->willReturn($response);
$factory->create(json_decode($data, true))->shouldBeCalled()->willReturn(array());

$this->search('sylius', [], 2);
Expand All @@ -50,7 +50,7 @@ function it_searches_for_packages_with_filters(HttpClient $client, Factory $fact
$data = file_get_contents('spec/Packagist/Api/Fixture/search.json');
$response->getBody()->shouldBeCalled()->willReturn($data);

$client->request('get', 'https://packagist.org/search.json?tag=storage&q=sylius')->shouldBeCalled()->willReturn($response);
$client->request('GET', 'https://packagist.org/search.json?tag=storage&q=sylius')->shouldBeCalled()->willReturn($response);

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

Expand All @@ -62,7 +62,7 @@ function it_gets_popular_packages(HttpClient $client, Factory $factory, Response
$data = file_get_contents('spec/Packagist/Api/Fixture/popular.json');
$response->getBody()->shouldBeCalled()->willReturn($data);

$client->request('get', 'https://packagist.org/explore/popular.json?page=1')->shouldBeCalled()->willReturn($response);
$client->request('GET', 'https://packagist.org/explore/popular.json?page=1')->shouldBeCalled()->willReturn($response);

$factory->create(json_decode($data, true))->shouldBeCalled()->willReturn(array_pad(array(), 5, null));

Expand All @@ -74,7 +74,7 @@ function it_gets_package_details(HttpClient $client, Factory $factory, Response
$data = file_get_contents('spec/Packagist/Api/Fixture/get.json');
$response->getBody()->shouldBeCalled()->willReturn($data);

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

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

Expand All @@ -86,7 +86,7 @@ function it_lists_all_package_names(HttpClient $client, Factory $factory, Respon
$data = file_get_contents('spec/Packagist/Api/Fixture/all.json');
$response->getBody()->shouldBeCalled()->willReturn($data);

$client->request('get', 'https://packagist.org/packages/list.json')->shouldBeCalled()->willReturn($response);
$client->request('GET', 'https://packagist.org/packages/list.json')->shouldBeCalled()->willReturn($response);

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

Expand All @@ -98,7 +98,7 @@ function it_filters_package_names_by_type(HttpClient $client, Factory $factory,
$data = file_get_contents('spec/Packagist/Api/Fixture/all.json');
$response->getBody()->shouldBeCalled()->willReturn($data);

$client->request('get', 'https://packagist.org/packages/list.json?type=library')->shouldBeCalled()->willReturn($response);
$client->request('GET', 'https://packagist.org/packages/list.json?type=library')->shouldBeCalled()->willReturn($response);

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

Expand All @@ -110,7 +110,7 @@ function it_filters_package_names_by_vendor(HttpClient $client, Factory $factory
$data = file_get_contents('spec/Packagist/Api/Fixture/all.json');
$response->getBody()->shouldBeCalled()->willReturn($data);

$client->request('get', 'https://packagist.org/packages/list.json?vendor=sylius')->shouldBeCalled()->willReturn($response);
$client->request('GET', 'https://packagist.org/packages/list.json?vendor=sylius')->shouldBeCalled()->willReturn($response);

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

Expand Down

0 comments on commit 9f4259e

Please sign in to comment.