Skip to content
This repository has been archived by the owner on Dec 2, 2021. It is now read-only.

Commit

Permalink
Fix test for newer Zend/Http library.
Browse files Browse the repository at this point in the history
  • Loading branch information
Roel van Duijnhoven committed Jun 14, 2018
1 parent 65eb5e2 commit 1e3212a
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions tests/src/JwPersistentUserTest/Service/CookieServiceTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ public function testReadSerie()

$result = $this->service->read($request, $response);

$this->assertFalse($response->getHeaders()->has('SetCookie'));
$this->assertFalse($response->getHeaders()->has('Set-Cookie'));

$this->assertNotNull($result);
$this->assertEquals(1, $result->getUserId());
Expand Down Expand Up @@ -73,8 +73,8 @@ public function testInvalidCookieNullifiesCookie()

$this->assertNull($result);

$this->assertTrue($response->getHeaders()->has('SetCookie'));
$cookie = $response->getHeaders()->get('SetCookie')->current();
$this->assertTrue($response->getHeaders()->has('Set-Cookie'));
$cookie = $response->getHeaders()->get('Set-Cookie')->current();
$this->assertInstanceOf('Zend\Http\Header\SetCookie', $cookie);
$this->assertEquals('JwPersistentUser', $cookie->getName());
$this->assertDateTimeEquals(new \DateTime('-1 hour'), new \DateTime($cookie->getExpires()));
Expand All @@ -88,8 +88,8 @@ public function testWriteNull()

$this->service->writeNull($response);

$this->assertTrue($response->getHeaders()->has('SetCookie'));
$cookie = $response->getHeaders()->get('SetCookie')->current();
$this->assertTrue($response->getHeaders()->has('Set-Cookie'));
$cookie = $response->getHeaders()->get('Set-Cookie')->current();
$this->assertInstanceOf('Zend\Http\Header\SetCookie', $cookie);
$this->assertEquals('JwPersistentUser', $cookie->getName());
$this->assertDateTimeEquals(new \DateTime('-1 hour'), new \DateTime($cookie->getExpires()));
Expand All @@ -106,8 +106,8 @@ public function testWriteSerie()

$this->service->writeSerie($response, $serie);

$this->assertTrue($response->getHeaders()->has('SetCookie'));
$cookie = $response->getHeaders()->get('SetCookie')->current();
$this->assertTrue($response->getHeaders()->has('Set-Cookie'));
$cookie = $response->getHeaders()->get('Set-Cookie')->current();
$this->assertInstanceOf('Zend\Http\Header\SetCookie', $cookie);
$this->assertEquals('JwPersistentUser', $cookie->getName());
$this->assertEquals('3:abc:def', $cookie->getValue());
Expand Down

0 comments on commit 1e3212a

Please sign in to comment.