-
-
Notifications
You must be signed in to change notification settings - Fork 2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixed incorrect return type hint for setSignKey
See: #14982
- Loading branch information
1 parent
4821b38
commit 726ece5
Showing
4 changed files
with
47 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,8 +4,8 @@ | |
* | ||
* (c) Phalcon Team <[email protected]> | ||
* | ||
* For the full copyright and license information, please view the LICENSE.txt | ||
* file that was distributed with this source code. | ||
* For the full copyright and license information, please view the | ||
* LICENSE.txt file that was distributed with this source code. | ||
*/ | ||
|
||
namespace Phalcon\Http\Response; | ||
|
@@ -312,7 +312,7 @@ class Cookies extends AbstractInjectionAware implements CookiesInterface | |
* | ||
* @see \Phalcon\Security\Random | ||
*/ | ||
public function setSignKey(string signKey = null) -> <CookieInterface> | ||
public function setSignKey(string signKey = null) -> <CookiesInterface> | ||
{ | ||
let this->signKey = signKey; | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,15 +5,16 @@ | |
* | ||
* (c) Phalcon Team <[email protected]> | ||
* | ||
* For the full copyright and license information, please view the LICENSE.txt | ||
* file that was distributed with this source code. | ||
* For the full copyright and license information, please view the | ||
* LICENSE.txt file that was distributed with this source code. | ||
*/ | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Phalcon\Test\Unit\Http\Response\Cookies; | ||
|
||
use Phalcon\Http\Response\Cookies; | ||
use Phalcon\Storage\Exception; | ||
use Phalcon\Test\Fixtures\Traits\CookieTrait; | ||
use Phalcon\Test\Unit\Http\Helper\HttpBase; | ||
use UnitTester; | ||
|
@@ -23,17 +24,27 @@ class DeleteCest extends HttpBase | |
use CookieTrait; | ||
|
||
/** | ||
* executed before each test | ||
* Executed before each test | ||
* | ||
* @param UnitTester $I | ||
* @return void | ||
*/ | ||
public function _before(UnitTester $I) | ||
public function _before(UnitTester $I): void | ||
{ | ||
parent::_before($I); | ||
$this->setDiService('sessionStream'); | ||
|
||
try { | ||
$this->setDiService('sessionStream'); | ||
} catch (Exception $e) { | ||
$I->fail($e->getMessage()); | ||
} | ||
} | ||
|
||
/** | ||
* Tests Phalcon\Http\Response\Cookies :: delete() | ||
* | ||
* @param UnitTester $I | ||
* | ||
* @author Jeremy PASTOURET <https://github.com/jenovateurs> | ||
* @since 2020-01-06 | ||
*/ | ||
|
@@ -44,7 +55,12 @@ public function httpResponseCookiesDelete(UnitTester $I) | |
$sName = 'framework'; | ||
$sValue = 'phalcon'; | ||
|
||
$this->setDiService('crypt'); | ||
try { | ||
$this->setDiService('crypt'); | ||
} catch (Exception $e) { | ||
$I->fail($e->getMessage()); | ||
} | ||
|
||
$container = $this->getDi(); | ||
|
||
$oCookie = new Cookies(); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,15 +5,16 @@ | |
* | ||
* (c) Phalcon Team <[email protected]> | ||
* | ||
* For the full copyright and license information, please view the LICENSE.txt | ||
* file that was distributed with this source code. | ||
* For the full copyright and license information, please view the | ||
* LICENSE.txt file that was distributed with this source code. | ||
*/ | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Phalcon\Test\Unit\Http\Response\Cookies; | ||
|
||
use Phalcon\Http\Response\Cookies; | ||
use Phalcon\Storage\Exception; | ||
use Phalcon\Test\Fixtures\Traits\CookieTrait; | ||
use Phalcon\Test\Unit\Http\Helper\HttpBase; | ||
use UnitTester; | ||
|
@@ -23,28 +24,40 @@ class SetSignKeyCest extends HttpBase | |
use CookieTrait; | ||
|
||
/** | ||
* executed before each test | ||
* Executed before each test | ||
* | ||
* @param UnitTester $I | ||
* @return void | ||
*/ | ||
public function _before(UnitTester $I) | ||
public function _before(UnitTester $I): void | ||
{ | ||
parent::_before($I); | ||
$this->setDiService('sessionStream'); | ||
|
||
try { | ||
$this->setDiService('sessionStream'); | ||
} catch (Exception $e) { | ||
$I->fail($e->getMessage()); | ||
} | ||
} | ||
|
||
/** | ||
* Tests Phalcon\Http\Response\Cookies :: setSignKey() | ||
* | ||
* @param UnitTester $I | ||
* | ||
* @author Jeremy PASTOURET <https://github.com/jenovateurs> | ||
* @since 2020-01-06 | ||
*/ | ||
public function httpResponseCookiesSetSignKey(UnitTester $I) | ||
{ | ||
$I->wantToTest('Http\Response\Cookies - setSignKey()'); | ||
|
||
$sName = 'framework'; | ||
$sValue = 'phalcon'; | ||
try { | ||
$this->setDiService('crypt'); | ||
} catch (Exception $e) { | ||
$I->fail($e->getMessage()); | ||
} | ||
|
||
$this->setDiService('crypt'); | ||
$container = $this->getDi(); | ||
|
||
$oCookie = new Cookies(); | ||
|