function title_case($string) { return Inflector::titleCase($string); }
/** * Test that strings are returned as title case sentences. */ public function testTitleCase() { $this->assertEquals('This Is A String With Studly Case', Inflector::titleCase('This is A sTring wIth sTudly cAse')); $this->assertEquals('And This One Has Underscores', Inflector::titleCase('and_this_ONE_has_underscores')); $this->assertEquals('While This One Contains -- Dashes', Inflector::titleCase('WHILE this one contains -- DASHES')); $this->assertEquals('This Is A Mix Of Underscores -- And Dashes', Inflector::titleCase('This_is A_MIX oF undeRscores -- aNd_dashes')); $this->assertEquals('Lastly, This String Contains "punctuation"!', Inflector::titleCase('LaStlY, this STRING contains "punctuation"!')); }