Permalink
Browse files

added tests

  • Loading branch information...
1 parent 61d2d0c commit f888ea36f277f6261d048f3413cdd2e4a42f758a @PHPGangsta committed Oct 3, 2012
Showing with 13 additions and 1 deletion.
  1. +13 −1 tests/ZendTest/Http/Header/SetCookieTest.php
@@ -153,7 +153,19 @@ public function testSetCookieCanAppendOtherHeadersInWhenCreatingString()
$this->assertEquals($target, $headerLine);
}
- /** Implmentation specific tests here */
+ public function testIsValidForRequestSubdomainMatch()
+ {
+ $setCookieHeader = new SetCookie(
+ 'myname', 'myvalue', 'Wed, 13-Jan-2021 22:23:01 GMT',
+ '/accounts', '.foo.com', true, true, 99, 9
+ );
+ $this->assertTrue($setCookieHeader->isValidForRequest('bar.foo.com', '/accounts', true));
+ $this->assertFalse($setCookieHeader->isValidForRequest('bar.foooo.com', '/accounts', true)); // false because of domain
+ $this->assertFalse($setCookieHeader->isValidForRequest('bar.foo.com', '/accounts', false)); // false because of isSecure
+ $this->assertFalse($setCookieHeader->isValidForRequest('bar.foo.com', '/somethingelse', true)); // false because of path
+ }
+
+ /** Implementation specific tests here */
/**
* @group ZF2-169

0 comments on commit f888ea3

Please sign in to comment.