mirror of
https://github.com/danielstjules/Stringy.git
synced 2025-08-16 02:04:09 +02:00
Added $charList and $type to trim function
Adding the option to trim the string with others characters, not only with the default characters provided by php. Also added the option to define the function which will be used to trim the string, if it's normal trim, left trim or right trim
This commit is contained in:
@@ -590,7 +590,7 @@ abstract class CommonTest extends PHPUnit_Framework_TestCase
|
||||
);
|
||||
}
|
||||
|
||||
public function trimProvider()
|
||||
public function trimProviderWithoutParams()
|
||||
{
|
||||
return array(
|
||||
array('foo bar', ' foo bar '),
|
||||
@@ -604,6 +604,23 @@ abstract class CommonTest extends PHPUnit_Framework_TestCase
|
||||
);
|
||||
}
|
||||
|
||||
public function trimProviderWithParams()
|
||||
{
|
||||
return array(
|
||||
array('foo bar', ' foo bar ', " \t\n\r\0\x0B", 'trim'),
|
||||
array('foo bar', ' foo bar', " \t\n\r\0\x0B", 'trim'),
|
||||
array('foo bar', 'foo bar ', " \t\n\r\0\x0B", 'trim'),
|
||||
array('foo bar', "\n\t foo bar \n\t", " \t\n\r\0\x0B", 'trim'),
|
||||
array('fòô bàř', ' fòô bàř ', " \t\n\r\0\x0B", 'trim'),
|
||||
array('fòô bàř', ' fòô bàř', " \t\n\r\0\x0B", 'trim'),
|
||||
array('fòô bàř', 'fòô bàř ', " \t\n\r\0\x0B", 'trim'),
|
||||
array('fòô bàř', "\n\t fòô bàř \n\t", " \t\n\r\0\x0B", 'trim'),
|
||||
array(' foo bar', ' foo bar ', " \t\n\r\0\x0B", 'rtrim'),
|
||||
array('foo bar ', ' foo bar ', " \t\n\r\0\x0B", 'ltrim'),
|
||||
array(' foo bar ', ' foo bar ', "\t\n\r\0\x0B", 'ltrim')
|
||||
);
|
||||
}
|
||||
|
||||
public function longestCommonPrefixProvider()
|
||||
{
|
||||
return array(
|
||||
|
Reference in New Issue
Block a user