diff options
author | Lukas Reschke <lukas@owncloud.com> | 2014-11-27 14:19:00 +0100 |
---|---|---|
committer | Lukas Reschke <lukas@owncloud.com> | 2014-11-27 14:19:00 +0100 |
commit | 048139074df674d0ac82da12357d3934af3abc2e (patch) | |
tree | 04e66fdbdc9fbb255036e36fe29b2274b3661af6 /tests/lib/appframework/AppTest.php | |
parent | e306b588d29d71bf547b19d1725ea9ad1a5fbf42 (diff) | |
download | nextcloud-server-048139074df674d0ac82da12357d3934af3abc2e.tar.gz nextcloud-server-048139074df674d0ac82da12357d3934af3abc2e.zip |
Add functions to modify cookies to response class
Currently there is no AppFramework way to modify cookies, which makes it unusable for quite some use-cases or results in untestable code.
This PR adds some basic functionalities to add and invalidate cookies.
Usage:
```php
$response = new TemplateResponse(...);
$response->addCookie('foo', 'bar');
$response->invalidateCookie('foo');
$response->addCookie('bar', 'foo', new \DateTime('2015-01-01 00:00'));
```
Existing cookies can be accessed with the AppFramework using `$this->request->getCookie($name)`.
Diffstat (limited to 'tests/lib/appframework/AppTest.php')
-rw-r--r-- | tests/lib/appframework/AppTest.php | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/tests/lib/appframework/AppTest.php b/tests/lib/appframework/AppTest.php index bd565e9765e..86128db118f 100644 --- a/tests/lib/appframework/AppTest.php +++ b/tests/lib/appframework/AppTest.php @@ -63,7 +63,7 @@ class AppTest extends \Test\TestCase { public function testControllerNameAndMethodAreBeingPassed(){ - $return = array(null, array(), null); + $return = array(null, array(), array(), null); $this->dispatcher->expects($this->once()) ->method('dispatch') ->with($this->equalTo($this->controller), |