Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Add missing CLIRequest::getCookie() #6646

Merged
merged 5 commits into from
Oct 9, 2022
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions system/HTTP/CLIRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -272,6 +272,20 @@ public function getGetPost($index = null, $filter = null, $flags = null)
return $this->returnNullOrEmptyArray($index);
}

/**
* This is a place holder for calls from cookie_helper get_cookie().
*
* @param array|string|null $index Index for item to be fetched from $_COOKIE
* @param int|null $filter A filter name to be applied
* @param mixed $flags
*
* @return null
sclubricants marked this conversation as resolved.
Show resolved Hide resolved
*/
public function getCookie($index = null, $filter = null, $flags = null)
{
return $this->returnNullOrEmptyArray($index);
}

/**
* @param array|string|null $index
*
Expand Down
7 changes: 7 additions & 0 deletions tests/system/HTTP/CLIRequestTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -616,4 +616,11 @@ public function testGetLocale()
{
$this->assertSame('en', $this->request->getLocale());
}

public function testGetCookie()
{
$this->assertNull($this->request->getCookie('TESTY'));

$this->assertSame($this->request->getCookie(), []);
}
}