SluggableHelperTest::testLowerCase()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 1
c 0
b 0
f 0
dl 0
loc 3
rs 10
cc 1
nc 1
nop 0
1
<?php declare(strict_types = 1);
2
3
namespace Suilven\Sluggable\Tests;
4
5
use SilverStripe\Dev\SapphireTest;
6
use Suilven\Sluggable\Helper\SluggableHelper;
7
8
class SluggableHelperTest extends SapphireTest
9
{
10
11
    public function testLowerCase(): void
12
    {
13
        $this->assertEquals('this-is-lower-case', $this->getSlug('this is lower case'));
14
    }
15
16
17
    public function testUpperCase(): void
18
    {
19
        $this->assertEquals('this-is-upper-case', $this->getSlug('THIS IS UPPER CASE'));
20
    }
21
22
23
    public function testMixedCase(): void
24
    {
25
        $this->assertEquals('this-is-mixed-case', $this->getSlug('THIs-Is-Mixed-case'));
26
    }
27
28
29
    public function testEmptyString(): void
30
    {
31
        $this->assertEquals('', $this->getSlug(''));
32
    }
33
34
35
    private function getSlug(string $title): string
36
    {
37
        $helper = new SluggableHelper();
38
39
        return $helper->getSlug($title);
40
    }
41
}
42