Skip to content
This repository has been archived by the owner on Oct 11, 2023. It is now read-only.

Commit

Permalink
Updated PHPUnit, do not set stops by default, fixes issue #5
Browse files Browse the repository at this point in the history
  • Loading branch information
ozdemirburak committed Dec 14, 2017
1 parent 0ee44be commit 914915c
Show file tree
Hide file tree
Showing 14 changed files with 30 additions and 17 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@

All Notable changes to `skyscanner-php` will be documented in this file

## 2017-12-14
- Updated PHPUnit

## 2017-05-26
- Major refactoring, not renaming the original object properties returned by the API itself
- Renamed Flights\LivePrices method name `parseFlights` to `getFlights`
Expand Down
6 changes: 3 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "ozdemirburak/skyscanner-php",
"description": "Unofficial PHP SDK for Skyscanner's API",
"keywords": ["skyscanner", "flight", "travel", "trip"],
"keywords": ["skyscanner", "skyscanner-api", "flight", "travel", "trip"],
"homepage": "https://github.com/ozdemirburak/skyscanner-php",
"license": "MIT",
"authors": [
Expand All @@ -16,8 +16,8 @@
"guzzlehttp/guzzle": "~6.0"
},
"require-dev": {
"phpunit/phpunit" : "~4.0|~5.0",
"symfony/var-dumper": "~2.8|~3.0"
"phpunit/phpunit" : "~5.0|~6.0",
"symfony/var-dumper": "~2.8|~3.2"
},
"autoload": {
"psr-4": { "OzdemirBurak\\SkyScanner\\": "src" },
Expand Down
6 changes: 3 additions & 3 deletions src/Traits/ReferralTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ trait ReferralTrait
*
* @return string
*/
public function getReferralLinkByParameters($country, $currency, $locale, $originPlace, $destinationPlace, $outboundPartialDate, $inboundPartialDate, $apiKey)
public function getReferralLinkByParameters($country, $currency, $locale, $originPlace, $destinationPlace, $outboundPartialDate, $inboundPartialDate = null, $apiKey = null)
{
return $this->referralUrl . implode('/', array_filter([
$country, $currency, $locale, $originPlace, $destinationPlace, $outboundPartialDate, $inboundPartialDate
Expand All @@ -34,7 +34,7 @@ public function getReferralLinkByParameters($country, $currency, $locale, $origi
*
* @return string
*/
public function getReferralLinkByArrayOfParameters($data, $apiKey)
public function getReferralLinkByArrayOfParameters($data, $apiKey = null)
{
if (is_array($data)) {
return $this->referralUrl . implode('/', array_filter($data)) . $this->getApiKeyQuery($apiKey);
Expand All @@ -49,6 +49,6 @@ public function getReferralLinkByArrayOfParameters($data, $apiKey)
*/
protected function getApiKeyQuery($apiKey)
{
return '?apiKey=' . substr($apiKey, 0, 16);
return !empty($apiKey) ? '?apiKey=' . substr($apiKey, 0, 16) : '';
}
}
2 changes: 1 addition & 1 deletion src/Travel/Flights/LivePricing.php
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@ class LivePricing extends TravelService
*
* @var int
*/
protected $stops = 0;
protected $stops;

/**
* The property to sort on. If specified, you must also specify sortorder
Expand Down
3 changes: 2 additions & 1 deletion tests/Localisation/CurrencyTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@
namespace OzdemirBurak\SkyScanner\Tests\Localisation;

use OzdemirBurak\SkyScanner\Localisation\Currency;
use PHPUnit\Framework\TestCase;

class CurrencyTest extends \PHPUnit_Framework_TestCase
class CurrencyTest extends TestCase
{
/**
* @group currency-tests
Expand Down
3 changes: 2 additions & 1 deletion tests/Localisation/LocaleTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@
namespace OzdemirBurak\SkyScanner\Tests\Localisation;

use OzdemirBurak\SkyScanner\Localisation\Locale;
use PHPUnit\Framework\TestCase;

class LocaleTest extends \PHPUnit_Framework_TestCase
class LocaleTest extends TestCase
{
/**
* @group locale-tests
Expand Down
3 changes: 2 additions & 1 deletion tests/Localisation/MarketTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@
namespace OzdemirBurak\SkyScanner\Tests\Localisation;

use OzdemirBurak\SkyScanner\Localisation\Market;
use PHPUnit\Framework\TestCase;

class MarketTest extends \PHPUnit_Framework_TestCase
class MarketTest extends TestCase
{
/**
* @group market-tests
Expand Down
3 changes: 2 additions & 1 deletion tests/PlacesTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@

use OzdemirBurak\SkyScanner\Exceptions\RestrictedMethodException;
use OzdemirBurak\SkyScanner\PlacesService;
use PHPUnit\Framework\TestCase;

class PlacesTest extends \PHPUnit_Framework_TestCase
class PlacesTest extends TestCase
{
/**
* @group places-tests
Expand Down
3 changes: 2 additions & 1 deletion tests/Traits/ConsoleTraitTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@
namespace OzdemirBurak\SkyScanner\Tests\Traits;

use OzdemirBurak\SkyScanner\Traits\ConsoleTrait;
use PHPUnit\Framework\TestCase;

class ConsoleTraitTest extends \PHPUnit_Framework_TestCase
class ConsoleTraitTest extends TestCase
{
use ConsoleTrait;

Expand Down
3 changes: 2 additions & 1 deletion tests/Traits/ImageTraitTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@
namespace OzdemirBurak\SkyScanner\Tests\Traits;

use OzdemirBurak\SkyScanner\Traits\ImageTrait;
use PHPUnit\Framework\TestCase;

class ImageTraitTest extends \PHPUnit_Framework_TestCase
class ImageTraitTest extends TestCase
{
use ImageTrait;

Expand Down
3 changes: 2 additions & 1 deletion tests/Traits/ReferralTraitTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@
namespace OzdemirBurak\SkyScanner\Tests\Traits;

use OzdemirBurak\SkyScanner\Traits\ReferralTrait;
use PHPUnit\Framework\TestCase;

class ReferralTraitTest extends \PHPUnit_Framework_TestCase
class ReferralTraitTest extends TestCase
{
use ReferralTrait;

Expand Down
3 changes: 2 additions & 1 deletion tests/Travel/CarHire/LivePricingTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@
namespace OzdemirBurak\SkyScanner\Tests\Travel\CarHire;

use OzdemirBurak\SkyScanner\Travel\CarHire\LivePricing;
use PHPUnit\Framework\TestCase;

class LivePricingTest extends \PHPUnit_Framework_TestCase
class LivePricingTest extends TestCase
{
/**
* @group cars-live-pricing-methods
Expand Down
3 changes: 2 additions & 1 deletion tests/Travel/Flights/BrowseCacheTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@

use OzdemirBurak\SkyScanner\Exceptions\InvalidMethodException;
use OzdemirBurak\SkyScanner\Travel\Flights\BrowseCache;
use PHPUnit\Framework\TestCase;

class BrowseCacheTest extends \PHPUnit_Framework_TestCase
class BrowseCacheTest extends TestCase
{
/**
* @group browse-cache-methods
Expand Down
3 changes: 2 additions & 1 deletion tests/Travel/Flights/LivePricingTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@
namespace OzdemirBurak\SkyScanner\Tests\Travel\Flights;

use OzdemirBurak\SkyScanner\Travel\Flights\LivePricing;
use PHPUnit\Framework\TestCase;

class LivePricingTest extends \PHPUnit_Framework_TestCase
class LivePricingTest extends TestCase
{
/**
* @group flights-live-pricing-methods
Expand Down

0 comments on commit 914915c

Please sign in to comment.