]> git.mxchange.org Git - friendica.git/blobdiff - tests/Util/StaticCookie.php
Merge pull request #10294 from annando/http-input-data
[friendica.git] / tests / Util / StaticCookie.php
index 9aeec0b3348f6ff4c1759b7494fa848fc90b23a4..a66025bf543958a7518ca8eafbfd76f8cc3b6917 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /**
- * @copyright Copyright (C) 2020, Friendica
+ * @copyright Copyright (C) 2010-2021, the Friendica project
  *
  * @license GNU AGPL version 3 or any later version
  *
@@ -33,10 +33,26 @@ class StaticCookie extends Cookie
        /** @var int The last expire time set */
        public static $_EXPIRE;
 
-       protected function setCookie(string $name, string $value = null, int $expire = null, bool $secure = null)
+       /**
+        * Send a cookie - protected, internal function for test-mocking possibility
+        *
+        * @param string $value  [optional]
+        * @param int    $expire [optional]
+        * @param bool   $secure [optional]
+        * @return bool
+        *
+        * @noinspection PhpMissingParentCallCommonInspection
+        *
+        * @link         https://php.net/manual/en/function.setcookie.php
+        *
+        * @see          Cookie::setCookie()
+        */
+       protected function setCookie(string $value = null, int $expire = null, bool $secure = null): bool
        {
-               self::$_COOKIE[$name] = $value;
+               self::$_COOKIE[self::NAME] = $value;
                self::$_EXPIRE = $expire;
+
+               return true;
        }
 
        public static function clearStatic()