PHP Classes

File: examples/url/URL_test.php

Recommend this page to a friend!
  Classes of Haseeb Ahmad Basil   PHP Skeleton Framework   examples/url/URL_test.php   Download  
File: examples/url/URL_test.php
Role: Example script
Content type: text/plain
Description: Example script
Class: PHP Skeleton Framework
Extensive Web application development framework
Author: By
Last change:
Date: 8 years ago
Size: 634 bytes
 

Contents

Class file image Download
<?php

include 'URL.php';

class
URLTest extends UnitTestCase {
   
    function
SetUp() {
    }
   
    function
TearDown() {
    }
   
    function
testURLSetGet() {
         
$url = new URL();

          
$serverstr = 'http://' . $_SERVER['HTTP_HOST'];

          
$expected = $serverstr . $_SERVER['SCRIPT_NAME'] . $_SERVER['PATH_INFO'];
          
$urlstr = $url->URL();
echo
"$urlstr, $expected<br/>";
       
$this->assertTrue($urlstr == $expected);

       
$targetstr = '/test/test.php';
          
$expected = $serverstr . $targetstr;
          
$urlstr = $url->URL($targetstr);
echo
"$urlstr, $expected<br/>";
       
$this->assertTrue($urlstr == $expected);
    }
   
}
?>