From 24420d7cb6ad95ac3aa19d6d3cca500d7f870a6f Mon Sep 17 00:00:00 2001 From: Christopher Georg Date: Fri, 26 Jan 2024 17:03:36 +0100 Subject: [PATCH] chore: allow PHPUnit 10, make DataProviders for PHPUnit static --- composer.json | 10 ++++++++-- tests/Tests/CurrencyPairTest.php | 4 ++-- tests/Tests/Service/ApiLayer/ExchangeRatesDataTest.php | 2 +- tests/Tests/Service/ExchangeRatesApiTest.php | 2 +- tests/Tests/Service/NationalBankOfRomaniaTest.php | 2 +- 5 files changed, 13 insertions(+), 7 deletions(-) diff --git a/composer.json b/composer.json index ef279c4..6d7c352 100644 --- a/composer.json +++ b/composer.json @@ -31,10 +31,11 @@ "php-http/discovery": "^1.6", "psr/http-factory": "^1.0.2", "php-http/client-implementation": "^1.0", - "psr/simple-cache": "^1.0 || ^2.0 || ^3.0" + "psr/simple-cache": "^1.0 || ^2.0 || ^3.0", + "symfony/http-client": "^7.0" }, "require-dev": { - "phpunit/phpunit": "^7 || ^8 || ^9.4", + "phpunit/phpunit": "^7 || ^8 || ^9.4 || ^10.5", "php-http/message": "^1.7", "php-http/mock-client": "^1.0", "nyholm/psr7": "^1.0" @@ -50,5 +51,10 @@ "suggest": { "php-http/message": "Required to use Guzzle for sending HTTP requests", "php-http/guzzle6-adapter": "Required to use Guzzle for sending HTTP requests" + }, + "config": { + "allow-plugins": { + "php-http/discovery": true + } } } diff --git a/tests/Tests/CurrencyPairTest.php b/tests/Tests/CurrencyPairTest.php index 58e5c26..95ee8c1 100644 --- a/tests/Tests/CurrencyPairTest.php +++ b/tests/Tests/CurrencyPairTest.php @@ -29,7 +29,7 @@ public function it_creates_a_pair_from_a_valid_string($string, $baseCurrency, $q $this->assertEquals($quoteCurrency, $pair->getQuoteCurrency()); } - public function validStringProvider() + public static function validStringProvider() { return [ ['EUR/USD', 'EUR', 'USD'], @@ -49,7 +49,7 @@ public function it_throws_an_exception_when_creating_from_an_invalid_string($str CurrencyPair::createFromString($string); } - public function invalidStringProvider() + public static function invalidStringProvider() { return [ ['EUR'], ['EUR/'], ['EU/US'], ['EUR/US'], ['US/EUR'], ['00'], ['00/'], ['007/00'], diff --git a/tests/Tests/Service/ApiLayer/ExchangeRatesDataTest.php b/tests/Tests/Service/ApiLayer/ExchangeRatesDataTest.php index f0f6030..4501371 100644 --- a/tests/Tests/Service/ApiLayer/ExchangeRatesDataTest.php +++ b/tests/Tests/Service/ApiLayer/ExchangeRatesDataTest.php @@ -82,7 +82,7 @@ public function it_throws_An_unsupported_currency_pair_exception( $service->getExchangeRate($query); } - public function unsupportedCurrencyPairResponsesProvider(): array + public static function unsupportedCurrencyPairResponsesProvider(): array { $dir = __DIR__.'/../../../Fixtures/Service/ApiLayer/ExchangeRatesData/'; diff --git a/tests/Tests/Service/ExchangeRatesApiTest.php b/tests/Tests/Service/ExchangeRatesApiTest.php index 83fd0a1..b81d03a 100644 --- a/tests/Tests/Service/ExchangeRatesApiTest.php +++ b/tests/Tests/Service/ExchangeRatesApiTest.php @@ -91,7 +91,7 @@ public function it_throws_An_unsupported_currency_pair_exception( $service->getExchangeRate($query); } - public function unsupportedCurrencyPairResponsesProvider(): array + public static function unsupportedCurrencyPairResponsesProvider(): array { $dir = __DIR__.'/../../Fixtures/Service/ExchangeRatesApi/'; diff --git a/tests/Tests/Service/NationalBankOfRomaniaTest.php b/tests/Tests/Service/NationalBankOfRomaniaTest.php index 31a1a24..8abb1db 100644 --- a/tests/Tests/Service/NationalBankOfRomaniaTest.php +++ b/tests/Tests/Service/NationalBankOfRomaniaTest.php @@ -156,7 +156,7 @@ public function it_has_a_name(): void $this->assertSame('national_bank_of_romania', $service->getName()); } - public function getSupportedCurrencies(): array + public static function getSupportedCurrencies(): array { return [ ['AED'],