PathTest::testGetSegments()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 2
nc 1
nop 0
dl 0
loc 4
rs 10
c 0
b 0
f 0
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Purl\Test;
6
7
use PHPUnit\Framework\TestCase;
8
use Purl\Path;
9
10
class PathTest extends TestCase
11
{
12
    public function testConstruct() : void
13
    {
14
        $path = new Path('test');
15
        $this->assertEquals('test', $path->getPath());
16
    }
17
18
    public function testGetSetPath() : void
19
    {
20
        $path = new Path();
21
        $this->assertEquals('', $path->getPath());
22
        $path->setPath('test');
23
        $this->assertEquals('test', $path->getPath());
24
    }
25
26
    public function testGetSegments() : void
27
    {
28
        $path = new Path('about/me');
29
        $this->assertEquals(['about', 'me'], $path->getSegments());
30
    }
31
32
    public function testToString() : void
33
    {
34
        $path = new Path('about/me');
35
        $this->assertEquals('about/me', (string) $path);
36
    }
37
}
38