File tree Expand file tree Collapse file tree 1 file changed +13
-2
lines changed Expand file tree Collapse file tree 1 file changed +13
-2
lines changed Original file line number Diff line number Diff line change 2424 */
2525class PerformanceTest extends PHPUnit
2626{
27- public function getRandomString ($ length = 2 )
27+ public function getRandomString ($ length = 6 )
2828 {
2929 $ chars = 'абвгд ' ;
3030 $ charsLength = strlen ($ chars );
@@ -37,7 +37,7 @@ public function getRandomString($length = 2)
3737 return $ result ;
3838 }
3939
40- public function testSlug ()
40+ public function testSlugCache ()
4141 {
4242 $ _this = $ this ;
4343
@@ -76,4 +76,15 @@ public function testSlug()
7676 },
7777 ), array ('count ' => 10000 , 'name ' => 'Rundom slug ' ));
7878 }
79+
80+ public function testSlugSpeed ()
81+ {
82+ $ _this = $ this ;
83+
84+ runBench (array (
85+ 'Slug::filter ' => function () use ($ _this ) {
86+ return Slug::filter ($ _this ->getRandomString (15 ));
87+ },
88+ ), array ('count ' => 1000 , 'name ' => 'Slug speed ' ));
89+ }
7990}
You can’t perform that action at this time.
0 commit comments