Skip to content

Commit d2b7b43

Browse files
author
SmetDenis
committed
slug filter tests
1 parent 5e5a807 commit d2b7b43

File tree

1 file changed

+17
-16
lines changed

1 file changed

+17
-16
lines changed

tests/StringTest.php

Lines changed: 17 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
namespace JBZoo\PHPUnit;
1717

1818
use JBZoo\Utils\Str;
19+
use JBZoo\Utils\Slug;
1920

2021
/**
2122
* Class StringTest
@@ -141,26 +142,26 @@ public function testLike()
141142

142143
public function testSlug()
143144
{
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));
148149

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));
153154

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));
158159

159160
// 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));
164165
}
165166

166167
public function testMBString()

0 commit comments

Comments
 (0)