Skip to content

Commit

Permalink
test: fix param types
Browse files Browse the repository at this point in the history
  • Loading branch information
kenjis committed Oct 25, 2023
1 parent 95fc2e2 commit 7c94d26
Show file tree
Hide file tree
Showing 8 changed files with 12 additions and 8 deletions.
2 changes: 1 addition & 1 deletion tests/system/CommonFunctionsSendTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ public function testRedirectResponseCookiesSent(): void

$response = redirect()->route('login')
->setCookie('foo', 'onething', YEAR)
->setCookie('login_time', $loginTime, YEAR);
->setCookie('login_time', (string) $loginTime, YEAR);
$response->pretend(false);
$this->assertTrue($response->hasCookie('foo', 'onething'));
$this->assertTrue($response->hasCookie('login_time'));
Expand Down
2 changes: 1 addition & 1 deletion tests/system/CommonFunctionsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -578,7 +578,7 @@ public function testRedirectResponseCookies1(): void

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

$this->assertTrue($answer1->hasCookie('foo', 'onething'));
$this->assertTrue($answer1->hasCookie('login_time'));
Expand Down
2 changes: 1 addition & 1 deletion tests/system/Debug/Toolbar/Collectors/HistoryTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ private function createDummyDebugbarJson(): void

// create 20 dummy debugbar json files
for ($i = 0; $i < 20; $i++) {
$path = str_replace($time, sprintf('%.6f', $time - self::STEP), $path);
$path = str_replace((string) $time, sprintf('%.6f', $time - self::STEP), $path);
file_put_contents($path, json_encode($dummyData));
$time = sprintf('%.6f', $time - self::STEP);
}
Expand Down
4 changes: 3 additions & 1 deletion tests/system/HTTP/ResponseSendTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -129,9 +129,11 @@ public function testRedirectResponseCookies(): void

$answer1 = $response->redirect('/login')
->setCookie('foo', 'bar', YEAR)
->setCookie('login_time', $loginTime, YEAR);
->setCookie('login_time', (string) $loginTime, YEAR);

$this->assertTrue($answer1->hasCookie('foo', 'bar'));
$this->assertTrue($answer1->hasCookie('login_time'));

$response->setBody('Hello');

// send it
Expand Down
2 changes: 1 addition & 1 deletion tests/system/HTTP/ResponseTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -553,7 +553,7 @@ public function testRedirectResponseCookies(): void
$response = new Response(new App());
$answer1 = $response->redirect('/login')
->setCookie('foo', 'bar', YEAR)
->setCookie('login_time', $loginTime, YEAR);
->setCookie('login_time', (string) $loginTime, YEAR);

$this->assertTrue($answer1->hasCookie('foo'));
$this->assertTrue($answer1->hasCookie('login_time'));
Expand Down
4 changes: 3 additions & 1 deletion tests/system/Helpers/CookieHelperTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -252,10 +252,12 @@ public function testSameSiteParamArray(): void

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

$this->assertTrue($this->response->hasCookie($this->name));

$theCookie = $this->response->getCookie($this->name);

$this->assertSame('Strict', $theCookie->getSameSite());

delete_cookie($this->name);
Expand Down
2 changes: 1 addition & 1 deletion tests/system/Helpers/FilesystemHelperTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ public function testDirectoryMapShowsHiddenFiles(): void
$root = vfsStream::setup('root', null, $this->structure);
$this->assertTrue($root->hasChild('foo'));

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

public function testDirectoryMapLimitsRecursion(): void
Expand Down
2 changes: 1 addition & 1 deletion tests/system/Helpers/TextHelperTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ public function testIncrementString(): void
$this->assertSame('file_5', increment_string('file_4'));
$this->assertSame('file-5', increment_string('file-4', '-'));
$this->assertSame('file-5', increment_string('file-4', '-'));
$this->assertSame('file-1', increment_string('file', '-', '1'));
$this->assertSame('file-1', increment_string('file', '-', 1));
$this->assertSame('124', increment_string('123', ''));
}

Expand Down

0 comments on commit 7c94d26

Please sign in to comment.