mirror of
https://github.com/danielstjules/Stringy.git
synced 2025-08-25 14:10:44 +02:00
Add casetitle function
This commit is contained in:
@@ -318,6 +318,17 @@ abstract class CommonTest extends PHPUnit_Framework_TestCase
|
||||
);
|
||||
}
|
||||
|
||||
public function toCaseTitleProvider()
|
||||
{
|
||||
return array(
|
||||
array( 'Foo Bar', 'foo bar'),
|
||||
array(' Foo_Bar ', ' foo_bar '),
|
||||
array('Fòô Bàř', 'fòô bàř', 'UTF-8'),
|
||||
array(' Fòô_Bàř ', ' fòô_bàř ', 'UTF-8'),
|
||||
array('Αυτοκίνητο Αυτοκίνητο', 'αυτοκίνητο αυτοκίνητο', 'UTF-8'),
|
||||
);
|
||||
}
|
||||
|
||||
public function toUpperCaseProvider()
|
||||
{
|
||||
return array(
|
||||
|
@@ -244,6 +244,16 @@ class StaticStringyTestCase extends CommonTest
|
||||
$this->assertEquals($expected, $result);
|
||||
}
|
||||
|
||||
/**
|
||||
* @dataProvider toCaseTitleProvider()
|
||||
*/
|
||||
public function testToCaseTitle($expected, $str, $encoding = null)
|
||||
{
|
||||
$result = S::toCaseTitle($str, $encoding);
|
||||
$this->assertInternalType('string', $result);
|
||||
$this->assertEquals($expected, $result);
|
||||
}
|
||||
|
||||
/**
|
||||
* @dataProvider toUpperCaseProvider()
|
||||
*/
|
||||
|
Reference in New Issue
Block a user