|
5 | 5 |
|
6 | 6 | # Diffbot PHP API Wrapper |
7 | 7 |
|
8 | | -This package is a slightly overengineered Diffbot API wrapper. It uses Guzzle to make API calls. To learn more about Diffbot see [here](http://www.sitepoint.com/tag/diffbot/) and [their homepage](http://diffbot.com). |
9 | | -Right now it only supports Analyze, Product, Image, Discussion and Article APIs, but can also accommodate Custom APIs. Crawlbot, Search and Video API support coming soon. |
| 8 | +This package is a slightly overengineered Diffbot API wrapper. It uses [PSR-7](http://www.php-fig.org/psr/psr-7/) and [PHP-HTTP](http://php-http.readthedocs.org/) friendly client implementations to make API calls. To learn more about Diffbot see [here](http://www.sitepoint.com/tag/diffbot/) and [their homepage](http://diffbot.com). |
| 9 | +Right now it only supports Analyze, Product, Image, Discussion, Crawl, Search, and Article APIs, but can also accommodate Custom APIs. Video and Bulk API support coming soon. |
10 | 10 |
|
11 | 11 | ## Requirements |
12 | 12 |
|
13 | | -Minimum PHP 5.6 is required. When installed via Composer, the library will pull in Guzzle 5 as well, so it's recommended you have cURL installed, but not required. |
| 13 | +Minimum PHP 5.6 is required. |
14 | 14 |
|
15 | 15 | ## Install |
16 | 16 |
|
17 | | -Via Composer |
| 17 | +The library depends on an implementation of the [client-implementation](https://packagist.org/providers/php-http/client-implementation) virtual package. If you don't know what this means, simply requiring the Guzzle6 adapter will do: |
| 18 | + |
| 19 | +```bash |
| 20 | +composer require php-http/guzzle6-adapter |
| 21 | +``` |
| 22 | + |
| 23 | +This adapter satisfies the requirement for client-implementation (see above) and will make it possible to install the client with: |
18 | 24 |
|
19 | 25 | ```bash |
20 | 26 | composer require swader/diffbot-php-client |
@@ -357,7 +363,7 @@ If you would like to contribute by adding Entity tests, I suggest following this |
357 | 363 | ``` |
358 | 364 |
|
359 | 365 | 3. Grab the URL and paste it into a REST client like Postman or into your browser. You'll get Diffbot's response back. Keep it open for reference. |
360 | | -4. Download this response, with headers, into a JSON file. Preferably into `tests/Mocks/Products/[date]/somefilename.json`, like the other tests are. This is easily accomplished by executing `curl -i "[url] > somefilename.json"` in the Terminal/Command Line. |
| 366 | +4. Download this response into a JSON file. Preferably into `tests/Mocks/Products/[date]/somefilename.json`, like the other tests are. This is easily accomplished by executing `curl "[url] > somefilename.json"` in the Terminal/Command Line. |
361 | 367 | 5. Go into the appropriate tests folder. In this case, `tests/Entity` and open `ProductTest.php`. Notice how the file is added into the batch of files to be tested against. Every provider has it referenced, along with the value the method being tested should produce. Slowly go through every test method and add your file. Use the values in the JSON you got in step 3 to get the values. |
362 | 368 | 6. Run `phpunit tests/Entity/ProductTest.php` to test just this file (much faster than entire suite). If OK, send PR :) |
363 | 369 |
|
|
0 commit comments