1
0
mirror of https://github.com/danielstjules/Stringy.git synced 2025-08-14 17:24:29 +02:00

Updated pad methods

This commit is contained in:
Daniel St. Jules
2014-03-18 23:56:37 -04:00
parent f0805f522d
commit e46797a9f8
5 changed files with 128 additions and 26 deletions

View File

@@ -181,6 +181,31 @@ abstract class CommonTest extends PHPUnit_Framework_TestCase
);
}
public function padProvider()
{
return array(
// length <= str
array('foo bar', 'foo bar', -1),
array('foo bar', 'foo bar', 7),
array('fòô bàř', 'fòô bàř', 7, ' ', 'right', 'UTF-8'),
// right
array('foo bar ', 'foo bar', 9),
array('foo bar_*', 'foo bar', 9, '_*', 'right'),
array('fòô bàř¬ø¬', 'fòô bàř', 10, '¬ø', 'right', 'UTF-8'),
// left
array(' foo bar', 'foo bar', 9, ' ', 'left'),
array('_*foo bar', 'foo bar', 9, '_*', 'left'),
array('¬ø¬fòô bàř', 'fòô bàř', 10, '¬ø', 'left', 'UTF-8'),
// both
array('foo bar ', 'foo bar', 8, ' ', 'both'),
array('¬fòô bàř¬ø', 'fòô bàř', 10, '¬ø', 'both', 'UTF-8'),
array('¬øfòô bàř¬øÿ', 'fòô bàř', 12, '¬øÿ', 'both', 'UTF-8')
);
}
public function padLeftProvider()
{
return array(