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

@@ -41,7 +41,7 @@ class DeleteShortUrlExceptionTest extends TestCase
self::assertEquals(422, $e->getStatus());
}
public function provideThresholds(): array
public static function provideThresholds(): array
{
return map(range(5, 50, 5), function (int $number) {
return [$number, $shortCode = generateRandomShortCode(6), sprintf(

View File

@@ -29,7 +29,7 @@ class ForbiddenTagOperationExceptionTest extends TestCase
self::assertEquals(403, $e->getStatus());
}
public function provideExceptions(): iterable
public static function provideExceptions(): iterable
{
yield 'deletion' => [ForbiddenTagOperationException::forDeletion(), 'You are not allowed to delete tags'];
yield 'renaming' => [ForbiddenTagOperationException::forRenaming(), 'You are not allowed to rename tags'];

View File

@@ -34,7 +34,7 @@ class InvalidUrlExceptionTest extends TestCase
self::assertEquals($prev, $e->getPrevious());
}
public function providePrevious(): iterable
public static function providePrevious(): iterable
{
yield 'null previous' => [null];
yield 'instance previous' => [new Exception('Previous error', 10)];

View File

@@ -53,7 +53,7 @@ class IpCannotBeLocatedExceptionTest extends TestCase
self::assertEquals(UnlocatableIpType::ERROR, $e->type);
}
public function provideErrors(): iterable
public static function provideErrors(): iterable
{
yield 'Simple exception with positive code' => [new Exception('Some message', 100)];
yield 'Runtime exception with negative code' => [new RuntimeException('Something went wrong', -50)];

View File

@@ -30,7 +30,7 @@ class NonUniqueSlugExceptionTest extends TestCase
self::assertEquals($expectedAdditional, $e->getAdditionalData());
}
public function provideMessages(): iterable
public static function provideMessages(): iterable
{
yield 'without domain' => [
'Provided slug "foo" is already in use.',

View File

@@ -34,7 +34,7 @@ class ShortUrlNotFoundExceptionTest extends TestCase
self::assertEquals($expectedAdditional, $e->getAdditionalData());
}
public function provideMessages(): iterable
public static function provideMessages(): iterable
{
yield 'without domain' => [
'No URL found with short code "abc123"',

View File

@@ -46,7 +46,7 @@ class ValidationExceptionTest extends TestCase
self::assertStringContainsString($expectedStringRepresentation, (string) $e);
}
public function provideExceptions(): iterable
public static function provideExceptions(): iterable
{
return [[null], [new RuntimeException()], [new LogicException()]];
}