[ Index ] |
|
Code source de LifeType 1.2.4 |
1 <?php 2 3 lt_include( PLOG_CLASS_PATH."class/test/helpers/lifetypetestcase.class.php" ); 4 lt_include( PLOG_CLASS_PATH."class/net/url.class.php" ); 5 6 /** 7 * \ingroup Test 8 * 9 * Test case for the Url class 10 */ 11 class Url_Test extends LifeTypeTestCase 12 { 13 var $url; 14 15 function setUp() 16 { 17 $this->url = new Url( "http://user:password@www.test-server.com:8080/path/to/script/test.php?param1=value1¶m2=value2#fragment" ); 18 } 19 20 function testGetHost() 21 { 22 $this->assertEquals( "www.test-server.com", $this->url->getHost()); 23 } 24 25 function testGetUser() 26 { 27 $this->assertEquals( "user", $this->url->getUser()); 28 } 29 30 function testGetPass() 31 { 32 $this->assertEquals( "password", $this->url->getPass()); 33 } 34 35 function testGetPort() 36 { 37 $this->assertEquals( "8080", $this->url->getPort()); 38 } 39 40 function testGetPath() 41 { 42 $this->assertEquals( "/path/to/script/test.php", $this->url->getPath()); 43 } 44 45 function testGetQuery() 46 { 47 $this->assertEquals( "param1=value1¶m2=value2", $this->url->getQuery()); 48 } 49 50 function testGetFragment() 51 { 52 $this->assertEquals( "fragment", $this->url->getFragment()); 53 } 54 55 function testSetHost() 56 { 57 $this->url->setHost( "www.lifetype.net" ); 58 $this->assertEquals( "www.lifetype.net", $this->url->getHost()); 59 } 60 61 function testSetQuery() 62 { 63 $this->url->setQuery( "a=b&c=d" ); 64 $this->assertEquals( "a=b&c=d", $this->url->getQuery()); 65 } 66 67 function testSetPath() 68 { 69 $this->url->setPath( "/blog.php/development_blog" ); 70 $this->assertEquals( "/blog.php/development_blog", $this->url->getPath()); 71 } 72 } 73 ?>
titre
Description
Corps
titre
Description
Corps
titre
Description
Corps
titre
Corps
Généré le : Mon Nov 26 21:04:15 2007 | par Balluche grâce à PHPXref 0.7 |
![]() |