Skip to content

Commit fe6db03

Browse files
author
SmetDenis
committed
slug speed test
1 parent d2b7b43 commit fe6db03

File tree

1 file changed

+13
-2
lines changed

1 file changed

+13
-2
lines changed

tests/PerformanceTest.php

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
*/
2525
class 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
}

0 commit comments

Comments
 (0)