Update to PHPUnit 10

This commit is contained in:
Alejandro Celaya
2023-02-09 09:32:38 +01:00
parent ad44a8441a
commit 650a286982
131 changed files with 335 additions and 315 deletions

View File

@@ -28,7 +28,7 @@ class AuthenticationTest extends ApiTestCase
self::assertEquals('Invalid authorization', $payload['title']);
}
public function provideApiVersions(): iterable
public static function provideApiVersions(): iterable
{
yield 'version 1' => ['1', 'INVALID_AUTHORIZATION'];
yield 'version 2' => ['2', 'INVALID_AUTHORIZATION'];
@@ -60,7 +60,7 @@ class AuthenticationTest extends ApiTestCase
self::assertEquals('Invalid API key', $payload['title']);
}
public function provideInvalidApiKeys(): iterable
public static function provideInvalidApiKeys(): iterable
{
yield 'key which does not exist' => ['invalid', '2', 'INVALID_API_KEY'];
yield 'key which is expired' => ['expired_api_key', '2', 'INVALID_API_KEY'];

View File

@@ -41,7 +41,7 @@ class CorsTest extends ApiTestCase
self::assertFalse($resp->hasHeader('Access-Control-Allow-Headers'));
}
public function provideOrigins(): iterable
public static function provideOrigins(): iterable
{
yield 'foo.com' => ['foo.com', '/short-urls', 200];
yield 'bar.io' => ['bar.io', '/foo/bar', 404];
@@ -69,7 +69,7 @@ class CorsTest extends ApiTestCase
self::assertEquals($allowedHeaders, $resp->getHeaderLine('Access-Control-Allow-Headers'));
}
public function providePreflightEndpoints(): iterable
public static function providePreflightEndpoints(): iterable
{
yield 'invalid route' => ['/foo/bar', 'GET,POST,PUT,PATCH,DELETE']; // TODO This won't work with multi-segment
yield 'short URLs route' => ['/short-urls', 'GET,POST'];