1
0
mirror of https://github.com/danielstjules/Stringy.git synced 2025-08-30 00:10:18 +02:00

Renamed toTitleCase

This commit is contained in:
Daniel St. Jules
2014-09-14 09:27:46 -07:00
parent 681463de87
commit c577684e0a
6 changed files with 36 additions and 10 deletions

View File

@@ -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'),

View File

@@ -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);
}

View File

@@ -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()
*/