Show
Ignore:
Timestamp:
10/02/08 23:45:03 (3 months ago)
Author:
sasezaki
Message:

modify getAbsoulteUrl() etc.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • lang/php/Scraper/tests/Diggin/Uri/HttpTest.php

    r20321 r20533  
    4040     * check getting absoluteUrl 
    4141     * 
    42      * 
    43      * import from rhaco's doc-test 
    44      * @see http://rhaco.googlecode.com/svn/trunk/1_6_1/network/Url.php 
    4542     */ 
    4643    public function testGetAbsoluteUrl() 
    4744    { 
     45        //if  
     46        $this->assertEquals('http://yahoo.com/test/',  
     47                             $this->object->getAbsoluteUrl('http://yahoo.com/test/', 'http://www.rhaco.org/')); 
     48         
     49        // import from rhaco's doc-test 
     50        // @see http://rhaco.googlecode.com/svn/trunk/1_6_1/network/Url.php 
    4851        $this->assertEquals('http://www.rhaco.org/doc/ja/index.html',  
    4952                             $this->object->getAbsoluteUrl('/doc/ja/index.html', 'http://www.rhaco.org/')); 
     
    7073        $this->assertEquals('http://www.rhaco.org/index.html',  
    7174                             $this->object->getAbsoluteUrl('/index.html', 'http://www.rhaco.org/doc/ja')); 
     75                              
     76                //@see http://d.hatena.ne.jp/kitamomonga/20080410/ruby_mechanize_percent_url_bug 
     77        $this->assertEquals('http://test.org/doc/ja/index.cgi?param=hoge',  
     78                             $this->object->getAbsoluteUrl('?param=hoge', 'http://test.org/doc/ja/index.cgi?test=bar')); 
     79        $this->assertEquals('http://test.org/index.php?param=hoge',  
     80                             $this->object->getAbsoluteUrl('?param=hoge', 'http://test.org/index.php'));                 
     81        //if space, 
     82        $this->assertEquals('http://www.rhaco.org/doc/ja/'.rawurlencode('test space.html'), 
     83                             $this->object->getAbsoluteUrl('test space.html', 'http://www.rhaco.org/doc/ja/')); 
     84         
    7285    } 
    7386}