diff --git a/system/HTTP/CLIRequest.php b/system/HTTP/CLIRequest.php index e81ae9cabbd9..64c0f0adae6d 100644 --- a/system/HTTP/CLIRequest.php +++ b/system/HTTP/CLIRequest.php @@ -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 array|null + */ + public function getCookie($index = null, $filter = null, $flags = null) + { + return $this->returnNullOrEmptyArray($index); + } + /** * @param array|string|null $index * diff --git a/tests/system/HTTP/CLIRequestTest.php b/tests/system/HTTP/CLIRequestTest.php index b294d1621b2b..cbec9b22a33e 100644 --- a/tests/system/HTTP/CLIRequestTest.php +++ b/tests/system/HTTP/CLIRequestTest.php @@ -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(), []); + } }