Feature #53677 » 53577-GeneralUtilityTest.patch
typo3/sysext/core/Tests/Unit/Utility/GeneralUtilityTest.php | ||
---|---|---|
'Element at end of list' => array('one,two,removeme', 'one,two'),
|
||
'One item list' => array('removeme', ''),
|
||
'Element not contained in list' => array('one,two,three', 'one,two,three'),
|
||
'Element with space and without trim' => array('one, removeme,two,three', 'one, removeme,two,three'),
|
||
'Empty list' => array('', '')
|
||
);
|
||
}
|
||
|
||
/**
|
||
* @test
|
||
* @param string $initialList
|
||
* @param string $listWithElementRemoved
|
||
* @dataProvider rmFromListWithTrimRemovesElementsFromCommaSeparatedListDataProvider
|
||
*/
|
||
public function rmFromListWithTrimRemovesElementsFromCommaSeparatedList($initialList, $listWithElementRemoved) {
|
||
$this->assertSame($listWithElementRemoved, Utility\GeneralUtility::rmFromList('removeme', $initialList, true));
|
||
}
|
||
/**
|
||
* Data provider for rmFromListRemovesElementsFromCommaSeparatedList
|
||
*
|
||
* @return array
|
||
*/
|
||
public function rmFromListWithTrimRemovesElementsFromCommaSeparatedListDataProvider() {
|
||
return array(
|
||
'Element as second element of three' => array('one,removeme,two', 'one,two'),
|
||
'Element at beginning of list' => array('removeme,one,two', 'one,two'),
|
||
'Element at end of list' => array('one,two,removeme', 'one,two'),
|
||
'One item list' => array('removeme', ''),
|
||
'Element not contained in list' => array('one,two,three', 'one,two,three'),
|
||
'Element with space and with trim' => array('one, removeme,two,three', 'one,two,three'),
|
||
'Empty list' => array('', '')
|
||
);
|
||
}
|
- « Previous
- 1
- 2
- Next »