Skip to content

Commit f8c8ca5

Browse files
committed
test: fix param types
1 parent 78dc645 commit f8c8ca5

File tree

9 files changed

+13
-9
lines changed

9 files changed

+13
-9
lines changed

tests/system/Commands/ClearDebugbarTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ protected function createDummyDebugbarJson(): void
3939

4040
// create 10 dummy debugbar json files
4141
for ($i = 0; $i < 10; $i++) {
42-
$path = str_replace($time, $time - $i, $path);
42+
$path = str_replace((string) $time, (string) ($time - $i), $path);
4343
file_put_contents($path, "{}\n");
4444

4545
$time -= $i;

tests/system/CommonFunctionsSendTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ public function testRedirectResponseCookiesSent(): void
4343

4444
$response = redirect()->route('login')
4545
->setCookie('foo', 'onething', YEAR)
46-
->setCookie('login_time', $loginTime, YEAR);
46+
->setCookie('login_time', (string) $loginTime, YEAR);
4747
$response->pretend(false);
4848
$this->assertTrue($response->hasCookie('foo', 'onething'));
4949
$this->assertTrue($response->hasCookie('login_time'));

tests/system/CommonFunctionsTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -576,7 +576,7 @@ public function testRedirectResponseCookies1(): void
576576

577577
$answer1 = redirect()->route('login')
578578
->setCookie('foo', 'onething', YEAR)
579-
->setCookie('login_time', $loginTime, YEAR);
579+
->setCookie('login_time', (string) $loginTime, YEAR);
580580

581581
$this->assertTrue($answer1->hasCookie('foo', 'onething'));
582582
$this->assertTrue($answer1->hasCookie('login_time'));

tests/system/Debug/Toolbar/Collectors/HistoryTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ private function createDummyDebugbarJson(): void
6161

6262
// create 20 dummy debugbar json files
6363
for ($i = 0; $i < 20; $i++) {
64-
$path = str_replace($time, sprintf('%.6f', $time - self::STEP), $path);
64+
$path = str_replace((string) $time, sprintf('%.6f', $time - self::STEP), $path);
6565
file_put_contents($path, json_encode($dummyData));
6666
$time = sprintf('%.6f', $time - self::STEP);
6767
}

tests/system/HTTP/ResponseSendTest.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,9 +127,11 @@ public function testRedirectResponseCookies(): void
127127

128128
$answer1 = $response->redirect('/login')
129129
->setCookie('foo', 'bar', YEAR)
130-
->setCookie('login_time', $loginTime, YEAR);
130+
->setCookie('login_time', (string) $loginTime, YEAR);
131+
131132
$this->assertTrue($answer1->hasCookie('foo', 'bar'));
132133
$this->assertTrue($answer1->hasCookie('login_time'));
134+
133135
$response->setBody('Hello');
134136

135137
// send it

tests/system/HTTP/ResponseTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -551,7 +551,7 @@ public function testRedirectResponseCookies(): void
551551
$response = new Response(new App());
552552
$answer1 = $response->redirect('/login')
553553
->setCookie('foo', 'bar', YEAR)
554-
->setCookie('login_time', $loginTime, YEAR);
554+
->setCookie('login_time', (string) $loginTime, YEAR);
555555

556556
$this->assertTrue($answer1->hasCookie('foo'));
557557
$this->assertTrue($answer1->hasCookie('login_time'));

tests/system/Helpers/CookieHelperTest.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -250,10 +250,12 @@ public function testSameSiteParamArray(): void
250250

251251
public function testSameSiteParam(): void
252252
{
253-
set_cookie($this->name, $this->value, $this->expire, '', '', '', '', '', 'Strict');
253+
set_cookie($this->name, $this->value, $this->expire, '', '', '', null, null, 'Strict');
254254

255255
$this->assertTrue($this->response->hasCookie($this->name));
256+
256257
$theCookie = $this->response->getCookie($this->name);
258+
257259
$this->assertSame('Strict', $theCookie->getSameSite());
258260

259261
delete_cookie($this->name);

tests/system/Helpers/FilesystemHelperTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ public function testDirectoryMapShowsHiddenFiles(): void
9292
$root = vfsStream::setup('root', null, $this->structure);
9393
$this->assertTrue($root->hasChild('foo'));
9494

95-
$this->assertSame($expected, directory_map(vfsStream::url('root'), false, true));
95+
$this->assertSame($expected, directory_map(vfsStream::url('root'), 0, true));
9696
}
9797

9898
public function testDirectoryMapLimitsRecursion(): void

tests/system/Helpers/TextHelperTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ public function testIncrementString(): void
136136
$this->assertSame('file_5', increment_string('file_4'));
137137
$this->assertSame('file-5', increment_string('file-4', '-'));
138138
$this->assertSame('file-5', increment_string('file-4', '-'));
139-
$this->assertSame('file-1', increment_string('file', '-', '1'));
139+
$this->assertSame('file-1', increment_string('file', '-', 1));
140140
$this->assertSame('124', increment_string('123', ''));
141141
}
142142

0 commit comments

Comments
 (0)