mirror of
https://github.com/shlinkio/shlink.git
synced 2026-03-11 17:44:44 +08:00
Update to PHPUnit 10
This commit is contained in:
@@ -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(
|
||||
|
||||
@@ -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'];
|
||||
|
||||
@@ -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)];
|
||||
|
||||
@@ -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)];
|
||||
|
||||
@@ -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.',
|
||||
|
||||
@@ -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"',
|
||||
|
||||
@@ -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()]];
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user