Skip to content

Commit 24420d7

Browse files
committed
chore: allow PHPUnit 10,
make DataProviders for PHPUnit static
1 parent f577e73 commit 24420d7

File tree

5 files changed

+13
-7
lines changed

5 files changed

+13
-7
lines changed

composer.json

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,11 @@
3131
"php-http/discovery": "^1.6",
3232
"psr/http-factory": "^1.0.2",
3333
"php-http/client-implementation": "^1.0",
34-
"psr/simple-cache": "^1.0 || ^2.0 || ^3.0"
34+
"psr/simple-cache": "^1.0 || ^2.0 || ^3.0",
35+
"symfony/http-client": "^7.0"
3536
},
3637
"require-dev": {
37-
"phpunit/phpunit": "^7 || ^8 || ^9.4",
38+
"phpunit/phpunit": "^7 || ^8 || ^9.4 || ^10.5",
3839
"php-http/message": "^1.7",
3940
"php-http/mock-client": "^1.0",
4041
"nyholm/psr7": "^1.0"
@@ -50,5 +51,10 @@
5051
"suggest": {
5152
"php-http/message": "Required to use Guzzle for sending HTTP requests",
5253
"php-http/guzzle6-adapter": "Required to use Guzzle for sending HTTP requests"
54+
},
55+
"config": {
56+
"allow-plugins": {
57+
"php-http/discovery": true
58+
}
5359
}
5460
}

tests/Tests/CurrencyPairTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ public function it_creates_a_pair_from_a_valid_string($string, $baseCurrency, $q
2929
$this->assertEquals($quoteCurrency, $pair->getQuoteCurrency());
3030
}
3131

32-
public function validStringProvider()
32+
public static function validStringProvider()
3333
{
3434
return [
3535
['EUR/USD', 'EUR', 'USD'],
@@ -49,7 +49,7 @@ public function it_throws_an_exception_when_creating_from_an_invalid_string($str
4949
CurrencyPair::createFromString($string);
5050
}
5151

52-
public function invalidStringProvider()
52+
public static function invalidStringProvider()
5353
{
5454
return [
5555
['EUR'], ['EUR/'], ['EU/US'], ['EUR/US'], ['US/EUR'], ['00'], ['00/'], ['007/00'],

tests/Tests/Service/ApiLayer/ExchangeRatesDataTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ public function it_throws_An_unsupported_currency_pair_exception(
8282
$service->getExchangeRate($query);
8383
}
8484

85-
public function unsupportedCurrencyPairResponsesProvider(): array
85+
public static function unsupportedCurrencyPairResponsesProvider(): array
8686
{
8787
$dir = __DIR__.'/../../../Fixtures/Service/ApiLayer/ExchangeRatesData/';
8888

tests/Tests/Service/ExchangeRatesApiTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ public function it_throws_An_unsupported_currency_pair_exception(
9191
$service->getExchangeRate($query);
9292
}
9393

94-
public function unsupportedCurrencyPairResponsesProvider(): array
94+
public static function unsupportedCurrencyPairResponsesProvider(): array
9595
{
9696
$dir = __DIR__.'/../../Fixtures/Service/ExchangeRatesApi/';
9797

tests/Tests/Service/NationalBankOfRomaniaTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ public function it_has_a_name(): void
156156
$this->assertSame('national_bank_of_romania', $service->getName());
157157
}
158158

159-
public function getSupportedCurrencies(): array
159+
public static function getSupportedCurrencies(): array
160160
{
161161
return [
162162
['AED'],

0 commit comments

Comments
 (0)