[ 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/http/httpclient.class.php" ); 5 lt_include( PLOG_CLASS_PATH."class/config/config.class.php" ); 6 7 /** 8 * \ingroup Test 9 * 10 * Test case for the Snoopy HTTP client library. It could do with a lot more tests 11 * but we're only testing the features that we really need in LT (namely some basic 12 * HTTP fetching stuff) 13 */ 14 class HttpClient_Test extends LifeTypeTestCase 15 { 16 var $c; 17 18 function setUp() 19 { 20 $this->c = new HttpClient(); 21 } 22 23 function testFetch() 24 { 25 // let's fetch our own base URL 26 $config =& Config::getConfig(); 27 $url = $config->getValue( "base_url" )."/index.php"; 28 29 $result = $this->c->fetch( $url ); 30 31 // check that it returned true 32 $this->assertTrue( $result ); 33 34 // and that there was content 35 $this->assertTrue(( $this->c->results != "" )); 36 } 37 38 function testWrongUrl() 39 { 40 $result = $this->c->fetch( "http://www.4523453h42345lhlk.com" ); 41 42 // check that it returned true 43 $this->assertFalse( $result ); 44 45 // and that there was content 46 $this->assertTrue(( $this->c->results == "" )); 47 } 48 } 49 ?>
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 |
![]() |