Project

General

Profile

Bug #20973 ยป 0011846.patch

Administrator Admin, 2009-09-01 19:33

View differences:

tests/t3lib/t3lib_div_testcase.php (Arbeitskopie)
$testUrl = t3lib_div::getIndpEnv('TYPO3_REQUEST_URL');
$this->assertTrue(t3lib_div::isOnCurrentHost($testUrl));
}
/**
* Tests whether removeDotsFromTS() behaves correctly.
* @test
* @see t3lib_div::removeDotsFromTS()
*/
public function doesRemoveDotsFromTypoScriptSucceed() {
$typoScript = array(
'propertyA.' => array(
'keyA.' => array(
'valueA' => 1,
),
'keyB' => 2,
),
'propertyB' => 3,
);
$expectedResult = array(
'propertyA' => array(
'keyA' => array(
'valueA' => 1,
),
'keyB' => 2,
),
'propertyB' => 3,
);
$this->assertEquals($expectedResult, t3lib_div::removeDotsFromTS($typoScript));
}
/**
* Tests whether removeDotsFromTS() behaves correctly.
* @test
* @see t3lib_div::removeDotsFromTS()
*/
public function doesRemoveDotsFromTypoScriptCorrectlyOverridesWithArray() {
$typoScript = array(
'propertyA.' => array(
'keyA' => 'getsOverridden',
'keyA.' => array(
'valueA' => 1,
),
'keyB' => 2,
),
'propertyB' => 3,
);
$expectedResult = array(
'propertyA' => array(
'keyA' => array(
'valueA' => 1,
),
'keyB' => 2,
),
'propertyB' => 3,
);
$this->assertEquals($expectedResult, t3lib_div::removeDotsFromTS($typoScript));
}
/**
* Tests whether removeDotsFromTS() behaves correctly.
* @test
* @see t3lib_div::removeDotsFromTS()
*/
public function doesRemoveDotsFromTypoScriptCorrectlyOverridesWithScalar() {
$typoScript = array(
'propertyA.' => array(
'keyA.' => array(
'valueA' => 1,
),
'keyA' => 'willOverride',
'keyB' => 2,
),
'propertyB' => 3,
);
$expectedResult = array(
'propertyA' => array(
'keyA' => 'willOverride',
'keyB' => 2,
),
'propertyB' => 3,
);
$this->assertEquals($expectedResult, t3lib_div::removeDotsFromTS($typoScript));
}
}
?>
    (1-1/1)