Project

General

Profile

Bug #23117 » t3lib_divTest.php_15029.patch

Administrator Admin, 2010-07-07 15:28

View differences:

tests/t3lib/t3lib_divTest.php (working copy)
rmdir($directory);
}
/**
* Data provider for checkIsFirstPartOfStrReturnsTrueForMatchingFirstParts
*
* @return array
*/
public function matchingFirstPartsDataProvider() {
return array(
'hello world/hello' => array('hello world', 'hello'),
'hello/hello' => array('hello', 'hello'),
'null/zero' => array(NULL, 0),
);
}
/**
* Checks if t3lib_div::isFirstPartOfStr returns true for a set of matching
* string/firstParts.
*
* @test
* @see t3lib_div::isFirstPartOfStr
* @dataProvider matchingFirstPartsDataProvider
*/
public function checkIsFirstPartOfStrReturnsTrueForMatchingFirstParts($str, $partStr) {
$this->assertTrue(t3lib_div::isFirstPartOfStr($str, $partStr));
}
/**
* Checks if t3lib_div::isFirstPartOfStr returns false for a not matching
* pair of string and firstPart.
*
* @test
* @see t3lib_div::isFirstPartOfStr
*/
public function checkIsFirstPartOfStrReturnsFlalseForForNotMatchingFirstPart() {
$this->assertFalse(t3lib_div::isFirstPartOfStr('hello world', 'ello'));
}
/**
* Checks if t3lib_div::isFirstPartOfStr returns false for special case
* empty string pair.
*
* @test
* @see t3lib_div::isFirstPartOfStr
*/
public function checkIsFirstPartOfStrReturnsFalseForEmptyStrings($str, $partStr) {
$this->assertFalse(t3lib_div::isFirstPartOfStr('', ''));
}
/**
* Checks if t3lib_div::isFirstPartOfStr returns false for special case
* null/null.
*
* @test
* @see t3lib_div::isFirstPartOfStr
*/
public function checkIsFirstPartOfStrReturnsFalseForNullAndNull($str, $partStr) {
$this->assertFalse(t3lib_div::isFirstPartOfStr(NULL, NULL));
}
/**
* Checks if t3lib_div::isFirstPartOfStr works case sensitive.
*
* @test
* @see t3lib_div::isFirstPartOfStr
*/
public function checkIsFirstPartOfStrWorksCaseSensitive($str, $partStr) {
$this->assertFalse(t3lib_div::isFirstPartOfStr('hello world', 'Hello'));
}
}
?>
(1-1/4)