Completed
Push — master ( 9b9083...4534a2 )
by Johannes
02:11
created

TagTest   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 25
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 4
lcom 1
cbo 2
dl 0
loc 25
rs 10
c 1
b 0
f 0

4 Methods

Rating   Name   Duplication   Size   Complexity  
A setUp() 0 4 1
A testGetId() 0 4 1
A testGetTitle() 0 4 1
A testTitleDefaultsToId() 0 5 1
1
<?php
2
/**
3
 * Lichtenwallner  (https://lichtenwallner.at)
4
 *
5
 * @see https://github.com/jolicht/markdown-cms for the canonical source repository
6
 * @license https://github.com/jolicht/markdown-cms/blob/master/LICENSE MIT
7
 * @copyright Copyright (c) Johannes Lichtenwallner
8
 */
9
declare(strict_types = 1);
10
namespace JolichtTest\MarkdownCms\Taxonomy;
11
12
use Jolicht\MarkdownCms\Taxonomy\Tag;
13
use PHPUnit\Framework\TestCase;
14
15
class TagTest extends TestCase
16
{
17
    private $tag;
18
19
    protected function setUp()
20
    {
21
        $this->tag = new Tag('test-id', 'testTitle');
22
    }
23
24
    public function testGetId()
25
    {
26
        $this->assertSame('test-id', $this->tag->getId());
27
    }
28
29
    public function testGetTitle()
30
    {
31
        $this->assertSame('testTitle', $this->tag->getTitle());
32
    }
33
34
    public function testTitleDefaultsToId()
35
    {
36
        $tag = new Tag('testId');
37
        $this->assertSame('testId', $tag->getTitle());
38
    }
39
}