Bug #23121 » 15034v4_UnitTest.patch
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($http_host, $expectedIp, $expectedPort)
|
||
*/
|
||
public function checkEqualityTypo3HostOnlyWithRefererHostEvenUnderInternetProtocolVersion6AddressAsHttpHost() {
|
||
$_SERVER['HTTP_HOST'] = $http_host;
|
||
$this->assertEquals($expectedIp, t3lib_div::getIndpEnv('TYPO3_HOST_ONLY'));
|
||
}
|
||
/**
|
||
* @test
|
||
* @dataProvider checkEqualityTypo3HostAndPortDataProvider
|
||
* @see t3lib_div::getIndpEnv()
|
||
*/
|
||
public function checkEqualityTypo3PortIsProperlyRecognizedWhenUsingInternetProtocolVersion6AddressAsHttpHost () {
|
||
$_SERVER['HTTP_HOST'] = $http_host;
|
||
$this->assertEquals($expectedPort, t3lib_div::getIndpEnv('TYPO3_PORT'));
|
||
}
|
||
////////////////////////////////////////
|
||
// Tests concerning sanitizeLocalUrl
|