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

T14602 setcookies #14604

Merged
merged 5 commits into from
Dec 9, 2019
Merged
Show file tree
Hide file tree
Changes from all 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
2 changes: 2 additions & 0 deletions CHANGELOG-4.0.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
## Changed
- Changed `Phalcon\Mvc\Router\Annotations` to use `converters` instead of `conversors` [#14532](https://github.com/phalcon/cphalcon/issues/14532)
- Changed `Phalcon\Di::setRaw` to `Phalcon\Di::setService` to align more with the use of the method [#14555](https://github.com/phalcon/cphalcon/issues/14555)
- Changed `Phalcon\Http\CookieInterface` to `Phalcon\Http\Cookie\CookieInterface` to avoid confusion [#14602](https://github.com/phalcon/cphalcon/issues/14602)

## Fixed
- Fixed `PhalconMvc\Model` to ignore internal setters if properties have the same name as the setter [#14538](https://github.com/phalcon/cphalcon/issues/14538)
Expand Down Expand Up @@ -37,6 +38,7 @@
- `Phalcon/Translate/TranslateFactory`
- `Phalcon/Validation/ValidatorFactory`
- Fixed `Phalcon\Mvc\Model::cloneResultMap` to cast integers when fields are `TYPE_BIGINTEGER`, `TYPE_INTEGER`, `TYPE_MEDIUMINTEGER`, `TYPE_SMALLINTEGER`, `TYPE_TINYINTEGER` [#14584](https://github.com/phalcon/cphalcon/issues/14584)
- Fixed `Phalcon\Http\Response::setCookies` to use the correct interface [#14602](https://github.com/phalcon/cphalcon/issues/14602)

# [4.0.0-rc.r3](https://github.com/phalcon/cphalcon/releases/tag/v4.0.0-rc.3) (2019-11-16)
## Added
Expand Down
21 changes: 9 additions & 12 deletions README.md

Large diffs are not rendered by default.

122 changes: 0 additions & 122 deletions ext/phalcon/http/cookieinterface.zep.c

This file was deleted.

166 changes: 0 additions & 166 deletions ext/phalcon/http/cookieinterface.zep.h

This file was deleted.

1 change: 1 addition & 0 deletions phalcon/Http/Cookie.zep
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ use Phalcon\Crypt\CryptInterface;
use Phalcon\Crypt\Mismatch;
use Phalcon\Filter\FilterInterface;
use Phalcon\Http\Response\Exception;
use Phalcon\Http\Cookie\CookieInterface;
use Phalcon\Http\Cookie\Exception as CookieException;
use Phalcon\Session\ManagerInterface as SessionManagerInterface;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
* file that was distributed with this source code.
*/

namespace Phalcon\Http;
namespace Phalcon\Http\Cookie;

/**
* Interface for Phalcon\Http\Cookie
Expand Down
2 changes: 1 addition & 1 deletion phalcon/Http/Response/Cookies.zep
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ namespace Phalcon\Http\Response;

use Phalcon\Di\DiInterface;
use Phalcon\Di\AbstractInjectionAware;
use Phalcon\Http\CookieInterface;
use Phalcon\Http\Cookie\Exception;
use Phalcon\Http\Cookie\CookieInterface;

/**
* Phalcon\Http\Response\Cookies
Expand Down
2 changes: 1 addition & 1 deletion phalcon/Http/Response/CookiesInterface.zep
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

namespace Phalcon\Http\Response;

use Phalcon\Http\CookieInterface;
use Phalcon\Http\Cookie\CookieInterface;

/**
* Phalcon\Http\Response\CookiesInterface
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/Http/Response/CookiesCest.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

use Phalcon\Di;
use Phalcon\Http\Cookie;
use Phalcon\Http\CookieInterface;
use Phalcon\Http\Cookie\CookieInterface;
use Phalcon\Http\Response;
use Phalcon\Http\Response\Cookies;
use Phalcon\Session\Adapter\Stream as SessionFiles;
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/Http/Response/GetReasonPhraseCest.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public function httpResponseGetReasonPhrase(UnitTester $I)
$oResponse = new Response('<h1>Test</h1>', 200, $sPhrase);

$I->assertSame(
$sPhrase,
$sPhrase,
$oResponse->getReasonPhrase()
);
}
Expand Down
18 changes: 13 additions & 5 deletions tests/unit/Http/Response/GetSetCookiesCest.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,15 @@
namespace Phalcon\Test\Unit\Http\Response;

use Phalcon\Http\Response;
use Phalcon\Http\Cookie;
use Phalcon\Http\Response\Cookies;
use Phalcon\Test\Fixtures\Traits\DiTrait;
use UnitTester;
use function var_dump;
Copy link
Member

@ruudboon ruudboon Dec 9, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@niden Only seeing this now. I think it can go.
Never mind this was already catched.


class GetSetCookiesCest
{
use DiTrait;

/**
* Tests Phalcon\Http\Response :: getCookies() / setCookies()
*
Expand All @@ -28,13 +32,17 @@ public function httpResponseGetSetCookies(UnitTester $I)
{
$I->wantToTest('Http\Response - getCookies() / setCookies');

$oCookie = new Cookie('firstname','jeremy');

$this->setNewFactoryDefault();

$oCookies = new Cookies();
$oCookies->setDI($this->container);
$oCookies->set('firstname', 'jeremy');

$oResponse = new Response();
$oResponse->setCookies($oCookie);
$oResponse->setCookies($oCookies);

$I->assertSame(
$oCookie,
$oCookies,
$oResponse->getCookies()
);
}
Expand Down
Loading