|
16 | 16 | namespace JBZoo\PHPUnit; |
17 | 17 |
|
18 | 18 | use JBZoo\Utils\Str; |
| 19 | +use JBZoo\Utils\Slug; |
19 | 20 |
|
20 | 21 | /** |
21 | 22 | * Class StringTest |
@@ -141,26 +142,26 @@ public function testLike() |
141 | 142 |
|
142 | 143 | public function testSlug() |
143 | 144 | { |
144 | | - is('a-simple-title', Str::slug(' A simple title ')); |
145 | | - is('this-post-it-has-a-dash', Str::slug('This post -- it has a dash')); |
146 | | - is('123-1251251', Str::slug('123----1251251')); |
147 | | - is('one23-1251251', Str::slug('123----1251251', '-', true)); |
| 145 | + is('a-simple-title', Slug::filter(' A simple title ')); |
| 146 | + is('this-post-it-has-a-dash', Slug::filter('This post -- it has a dash')); |
| 147 | + is('123-1251251', Slug::filter('123----1251251')); |
| 148 | + is('one23-1251251', Slug::filter('123----1251251', '-', true)); |
148 | 149 |
|
149 | | - is('a-simple-title', Str::slug('A simple title', '-')); |
150 | | - is('this-post-it-has-a-dash', Str::slug('This post -- it has a dash', '-')); |
151 | | - is('123-1251251', Str::slug('123----1251251', '-')); |
152 | | - is('one23-1251251', Str::slug('123----1251251', '-', true)); |
| 150 | + is('a-simple-title', Slug::filter('A simple title', '-')); |
| 151 | + is('this-post-it-has-a-dash', Slug::filter('This post -- it has a dash', '-')); |
| 152 | + is('123-1251251', Slug::filter('123----1251251', '-')); |
| 153 | + is('one23-1251251', Slug::filter('123----1251251', '-', true)); |
153 | 154 |
|
154 | | - is('a_simple_title', Str::slug('A simple title', '_')); |
155 | | - is('this_post_it_has_a_dash', Str::slug('This post -- it has a dash', '_')); |
156 | | - is('123_1251251', Str::slug('123----1251251', '_')); |
157 | | - is('one23_1251251', Str::slug('123----1251251', '_', true)); |
| 155 | + is('a_simple_title', Slug::filter('A simple title', '_')); |
| 156 | + is('this_post_it_has_a_dash', Slug::filter('This post -- it has a dash', '_')); |
| 157 | + is('123_1251251', Slug::filter('123----1251251', '_')); |
| 158 | + is('one23_1251251', Slug::filter('123----1251251', '_', true)); |
158 | 159 |
|
159 | 160 | // Blank seperator tests |
160 | | - is('asimpletitle', Str::slug('A simple title', '')); |
161 | | - is('thispostithasadash', Str::slug('This post -- it has a dash', '')); |
162 | | - is('1231251251', Str::slug('123----1251251', '')); |
163 | | - is('one231251251', Str::slug('123----1251251', '', true)); |
| 161 | + is('asimpletitle', Slug::filter('A simple title', '')); |
| 162 | + is('thispostithasadash', Slug::filter('This post -- it has a dash', '')); |
| 163 | + is('1231251251', Slug::filter('123----1251251', '')); |
| 164 | + is('one231251251', Slug::filter('123----1251251', '', true)); |
164 | 165 | } |
165 | 166 |
|
166 | 167 | public function testMBString() |
|
0 commit comments