Project

General

Profile

Bug #23121 » 15034v5_UnitTest.patch

Administrator Admin, 2010-07-09 02:11

View differences:

tests/t3lib/t3lib_divTest.php (working copy)
$this->assertTrue(t3lib_div::isOnCurrentHost($testUrl));
}
////////////////////////////////////////////
// Tests concerning t3lib_div::getIndpEnv
////////////////////////////////////////////
/**
* Data provider for checkEqualityTypo3HostOnlyWithRefererHostEvenUnderInternetProtocolVersion6AddressAsHttpHost
*
* @return array Data sets
*/
public static function checkEqualityTypo3HostAndPortDataProvider() {
return array(
array('127.0.0.1','127.0.0.1',''),
array('127.0.0.1:81','127.0.0.1','81'),
array('[::1]','[::1]',''),
array('[::1]:81','[::1]','81'),
array('[2001:DB8::1]','[2001:DB8::1]',''),
array('[2001:DB8::1]:81','[2001:DB8::1]','81'),
);
}
/**
* @test
* @dataProvider checkEqualityTypo3HostAndPortDataProvider
* @see t3lib_div::getIndpEnv()
*/
public function checkEqualityTypo3HostOnlyWithRefererHostEvenUnderInternetProtocolVersion6AddressAsHttpHost($http_host, $expectedIp, $expectedPort) {
$_SERVER['HTTP_HOST'] = $http_host;
$this->assertEquals($expectedIp, t3lib_div::getIndpEnv('TYPO3_HOST_ONLY'));
}
/**
* @test
* @dataProvider checkEqualityTypo3HostAndPortDataProvider
* @see t3lib_div::getIndpEnv()
*/
public function checkEqualityTypo3PortIsProperlyRecognizedWhenUsingInternetProtocolVersion6AddressAsHttpHost ($http_host, $expectedIp, $expectedPort) {
$_SERVER['HTTP_HOST'] = $http_host;
$this->assertEquals($expectedPort, t3lib_div::getIndpEnv('TYPO3_PORT'));
}
////////////////////////////////////////
// Tests concerning sanitizeLocalUrl
(8-8/15)