Changeset 1048

Show
Ignore:
Timestamp:
11/17/07 13:14:35 (1 year ago)
Author:
mikey
Message:

added test using dns check

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/src/test/php/net/stubbles/ipo/request/filters/stubHTTPURLFilterTestCase.php

    r1037 r1048  
    106106        $this->httpURLFilter->execute('http://wrong example!'); 
    107107    } 
     108 
     109    /** 
     110     * assert that a non-existing but correct URL is treated correct 
     111     */ 
     112    public function testURLNotAvailable() 
     113    { 
     114        $this->assertFalse($this->httpURLFilter->isDNSCheckEnabled()); 
     115        $this->assertEqual($this->httpURLFilter->execute('http://doesnotexist.1und1.de/'), 'http://doesnotexist.1und1.de/'); 
     116        $this->httpURLFilter->setCheckDNS(true); 
     117        $this->assertTrue($this->httpURLFilter->isDNSCheckEnabled()); 
     118        if (DIRECTORY_SEPARATOR === '\\') { 
     119            // Windows does not support dns checks, filter will always return ok 
     120            $this->assertEqual($this->httpURLFilter->execute('http://doesnotexist.1und1.de/'), 'http://doesnotexist.1und1.de/'); 
     121        } else { 
     122            $this->mockStubRequestValueErrorFactory->expect('create', array('URL_NOT_AVAILABLE')); 
     123            $this->expectException('stubFilterException'); 
     124            $this->httpURLFilter->execute('http://doesnotexist.1und1.de/'); 
     125        } 
     126    } 
    108127} 
    109128?>