@@ -14,18 +14,19 @@ class StringTest extends PHPUnit_Framework_TestCase
1414 * @param $expected
1515 * @param $capitalize
1616 * @param $separator
17+ * @param array $forbiddenWords
1718 */
18- public function test_humanize_strings ($ input , $ expected , $ capitalize , $ separator )
19+ public function test_humanize_strings ($ input , $ expected , $ capitalize , $ separator, array $ forbiddenWords )
1920 {
20- $ this ->assertEquals ($ expected , String::humanize ($ input , $ capitalize , $ separator ));
21+ $ this ->assertEquals ($ expected , String::humanize ($ input , $ capitalize , $ separator, $ forbiddenWords ));
2122 }
2223
2324 /**
2425 * @dataProvider truncateStringProvider
2526 *
26- * @param $text
27- * @param $expected
28- * @param $charactersCount
27+ * @param $text
28+ * @param $expected
29+ * @param $charactersCount
2930 * @param string $append
3031 */
3132 function test_truncate_string_to_word_closest_to_a_certain_number_of_characters ($ text , $ expected , $ charactersCount , $ append = '' )
@@ -40,12 +41,13 @@ function test_truncate_string_to_word_closest_to_a_certain_number_of_characters(
4041 public function humanizeStringProvider ()
4142 {
4243 return array (
43- array ('news_count ' , 'News count ' , true , '_ ' ),
44- array ('user ' , 'user ' , false , '_ ' ),
45- array ('news_id ' , 'News ' , true , '_ ' ),
46- array ('news_count ' , 'News count ' , true , '_ ' ),
47- array ('news-count ' , 'News count ' , true , '- ' ),
48- array ('news-count ' , 'news count ' , false , '- ' )
44+ array ('news_count ' , 'News count ' , true , '_ ' , array ('id ' )),
45+ array ('user ' , 'user ' , false , '_ ' , array ('id ' )),
46+ array ('news_id ' , 'News ' , true , '_ ' , array ('id ' )),
47+ array ('customer_id ' , 'Customer id ' , true , '_ ' , array ()),
48+ array ('news_count ' , 'News count ' , true , '_ ' , array ('id ' )),
49+ array ('news-count ' , 'News count ' , true , '- ' , array ('id ' )),
50+ array ('news-count ' , 'news count ' , false , '- ' , array ('id ' ))
4951 );
5052 }
5153
0 commit comments