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

@@ -29,7 +29,7 @@ class VisitorTest extends TestCase
self::assertEquals($remoteAddress, $visitor->remoteAddress);
}
public function provideParams(): iterable
public static function provideParams(): iterable
{
yield 'all values are bigger' => [
[str_repeat('a', 1000), str_repeat('b', 2000), str_repeat('c', 500), ''],
@@ -49,8 +49,8 @@ class VisitorTest extends TestCase
];
yield 'random strings' => [
[
$userAgent = $this->generateRandomString(2000),
$referer = $this->generateRandomString(50),
$userAgent = self::generateRandomString(2000),
$referer = self::generateRandomString(50),
null,
'',
],
@@ -62,7 +62,7 @@ class VisitorTest extends TestCase
];
}
private function generateRandomString(int $length): string
private static function generateRandomString(int $length): string
{
$characters = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';
$charactersLength = strlen($characters);
@@ -77,10 +77,10 @@ class VisitorTest extends TestCase
public function newNormalizedInstanceIsCreatedFromTrackingOptions(): void
{
$visitor = new Visitor(
$this->generateRandomString(2000),
$this->generateRandomString(2000),
$this->generateRandomString(2000),
$this->generateRandomString(2000),
self::generateRandomString(2000),
self::generateRandomString(2000),
self::generateRandomString(2000),
self::generateRandomString(2000),
);
$normalizedVisitor = $visitor->normalizeForTrackingOptions(new TrackingOptions(
disableIpTracking: true,