diff options
author | tof <> | 2007-06-13 12:01:20 +0000 |
---|---|---|
committer | tof <> | 2007-06-13 12:01:20 +0000 |
commit | 56df3d3faa32bb92223b363945ce0b19761f040f (patch) | |
tree | 17742fb863a02dab33c003636941354df4062ca0 /tests/unit/Web/THttpCookieTest.php | |
parent | 643386f289d94e6c4484e0c9dbabc22e5a373b1c (diff) |
Implements THttpCookie, THttpCookieCollection, and THttpRequest unit tests
Diffstat (limited to 'tests/unit/Web/THttpCookieTest.php')
-rw-r--r-- | tests/unit/Web/THttpCookieTest.php | 29 |
1 files changed, 22 insertions, 7 deletions
diff --git a/tests/unit/Web/THttpCookieTest.php b/tests/unit/Web/THttpCookieTest.php index 8a96e35e..0d6ade09 100644 --- a/tests/unit/Web/THttpCookieTest.php +++ b/tests/unit/Web/THttpCookieTest.php @@ -9,31 +9,46 @@ Prado::using('System.Web.THttpRequest'); class THttpCookieTest extends PHPUnit_Framework_TestCase { public function testConstruct() { - throw new PHPUnit_Framework_IncompleteTestError(); + $cookie=new THttpCookie('name','value'); + self::assertEquals('name',$cookie->getName()); + self::assertEquals('value',$cookie->getValue()); } public function testSetDomain() { - throw new PHPUnit_Framework_IncompleteTestError(); + $cookie=new THttpCookie('name','value'); + $cookie->setDomain('pradosoft.com'); + self::assertEquals('pradosoft.com',$cookie->getdomain()); } public function testSetExpire() { - throw new PHPUnit_Framework_IncompleteTestError(); + $cookie=new THttpCookie('name','value'); + $exp=time()+3600; + $cookie->setExpire($exp); + self::assertEquals($exp,$cookie->getExpire()); } public function testSetName() { - throw new PHPUnit_Framework_IncompleteTestError(); + $cookie=new THttpCookie('name','value'); + $cookie->setName('newName'); + self::assertEquals('newName', $cookie->getName()); } public function testSetValue() { - throw new PHPUnit_Framework_IncompleteTestError(); + $cookie=new THttpCookie('name','value'); + $cookie->setValue('newValue'); + self::assertEquals('newValue', $cookie->getValue()); } public function testSetPath() { - throw new PHPUnit_Framework_IncompleteTestError(); + $cookie=new THttpCookie('name','value'); + $cookie->setPath('/admin'); + self::assertEquals('/admin', $cookie->getPath()); } public function testSetSecure() { - throw new PHPUnit_Framework_IncompleteTestError(); + $cookie=new THttpCookie('name','value'); + $cookie->setSecure(true); + self::assertTrue($cookie->getSecure()); } } ?>
\ No newline at end of file |