From 56df3d3faa32bb92223b363945ce0b19761f040f Mon Sep 17 00:00:00 2001 From: tof <> Date: Wed, 13 Jun 2007 12:01:20 +0000 Subject: Implements THttpCookie, THttpCookieCollection, and THttpRequest unit tests --- tests/unit/Web/THttpCookieTest.php | 29 ++++++++++++++++++++++------- 1 file changed, 22 insertions(+), 7 deletions(-) (limited to 'tests/unit/Web/THttpCookieTest.php') 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 -- cgit v1.2.3