mirror of
https://github.com/danielstjules/Stringy.git
synced 2025-08-30 00:10:18 +02:00
Renamed toTitleCase
This commit is contained in:
@@ -318,10 +318,10 @@ abstract class CommonTest extends PHPUnit_Framework_TestCase
|
||||
);
|
||||
}
|
||||
|
||||
public function toCaseTitleProvider()
|
||||
public function toTitleCaseProvider()
|
||||
{
|
||||
return array(
|
||||
array( 'Foo Bar', 'foo bar'),
|
||||
array('Foo Bar', 'foo bar'),
|
||||
array(' Foo_Bar ', ' foo_bar '),
|
||||
array('Fòô Bàř', 'fòô bàř', 'UTF-8'),
|
||||
array(' Fòô_Bàř ', ' fòô_bàř ', 'UTF-8'),
|
||||
|
@@ -245,11 +245,11 @@ class StaticStringyTestCase extends CommonTest
|
||||
}
|
||||
|
||||
/**
|
||||
* @dataProvider toCaseTitleProvider()
|
||||
* @dataProvider toTitleCaseProvider()
|
||||
*/
|
||||
public function testToCaseTitle($expected, $str, $encoding = null)
|
||||
public function testToTitleCase($expected, $str, $encoding = null)
|
||||
{
|
||||
$result = S::toCaseTitle($str, $encoding);
|
||||
$result = S::toTitleCase($str, $encoding);
|
||||
$this->assertInternalType('string', $result);
|
||||
$this->assertEquals($expected, $result);
|
||||
}
|
||||
|
@@ -432,6 +432,18 @@ class StringyTestCase extends CommonTest
|
||||
$this->assertEquals($str, $stringy);
|
||||
}
|
||||
|
||||
/**
|
||||
* @dataProvider toTitleCaseProvider()
|
||||
*/
|
||||
public function testToTitleCase($expected, $str, $encoding = null)
|
||||
{
|
||||
$stringy = S::create($str, $encoding);
|
||||
$result = $stringy->toTitleCase();
|
||||
$this->assertInstanceOf('Stringy\Stringy', $result);
|
||||
$this->assertEquals($expected, $result);
|
||||
$this->assertEquals($str, $stringy);
|
||||
}
|
||||
|
||||
/**
|
||||
* @dataProvider toUpperCaseProvider()
|
||||
*/
|
||||
|
Reference in New Issue
Block a user