Skip to content

Commit 7c94d26

Browse files
committed
test: fix param types
1 parent 95fc2e2 commit 7c94d26

File tree

8 files changed

+12
-8
lines changed

8 files changed

+12
-8
lines changed

tests/system/CommonFunctionsSendTest.php

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

4646
$response = redirect()->route('login')
4747
->setCookie('foo', 'onething', YEAR)
48-
->setCookie('login_time', $loginTime, YEAR);
48+
->setCookie('login_time', (string) $loginTime, YEAR);
4949
$response->pretend(false);
5050
$this->assertTrue($response->hasCookie('foo', 'onething'));
5151
$this->assertTrue($response->hasCookie('login_time'));

tests/system/CommonFunctionsTest.php

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

579579
$answer1 = redirect()->route('login')
580580
->setCookie('foo', 'onething', YEAR)
581-
->setCookie('login_time', $loginTime, YEAR);
581+
->setCookie('login_time', (string) $loginTime, YEAR);
582582

583583
$this->assertTrue($answer1->hasCookie('foo', 'onething'));
584584
$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
@@ -63,7 +63,7 @@ private function createDummyDebugbarJson(): void
6363

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

tests/system/HTTP/ResponseSendTest.php

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

130130
$answer1 = $response->redirect('/login')
131131
->setCookie('foo', 'bar', YEAR)
132-
->setCookie('login_time', $loginTime, YEAR);
132+
->setCookie('login_time', (string) $loginTime, YEAR);
133+
133134
$this->assertTrue($answer1->hasCookie('foo', 'bar'));
134135
$this->assertTrue($answer1->hasCookie('login_time'));
136+
135137
$response->setBody('Hello');
136138

137139
// send it

tests/system/HTTP/ResponseTest.php

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

558558
$this->assertTrue($answer1->hasCookie('foo'));
559559
$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
@@ -252,10 +252,12 @@ public function testSameSiteParamArray(): void
252252

253253
public function testSameSiteParam(): void
254254
{
255-
set_cookie($this->name, $this->value, $this->expire, '', '', '', '', '', 'Strict');
255+
set_cookie($this->name, $this->value, $this->expire, '', '', '', null, null, 'Strict');
256256

257257
$this->assertTrue($this->response->hasCookie($this->name));
258+
258259
$theCookie = $this->response->getCookie($this->name);
260+
259261
$this->assertSame('Strict', $theCookie->getSameSite());
260262

261263
delete_cookie($this->name);

tests/system/Helpers/FilesystemHelperTest.php

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

97-
$this->assertSame($expected, directory_map(vfsStream::url('root'), false, true));
97+
$this->assertSame($expected, directory_map(vfsStream::url('root'), 0, true));
9898
}
9999

100100
public function testDirectoryMapLimitsRecursion(): void

tests/system/Helpers/TextHelperTest.php

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

0 commit comments

Comments
 (0)