Completed
Push — master ( 3cad72...8fd855 )
by Tim
13:41
created

QuestionTest   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 28
Duplicated Lines 100 %

Coupling/Cohesion

Components 1
Dependencies 2

Importance

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

How to fix   Duplicated Code   

Duplicated Code

Duplicate code is one of the most pungent code smells. A rule that is often used is to re-structure code once it is duplicated in three or more places.

Common duplication problems, and corresponding solutions are:

1
<?php
2
/**
3
 * QuestionTest
4
 */
5
6
namespace HDNET\Faq\Tests\Unit\Domain\Model;
7
8
use HDNET\Faq\Domain\Model\Question;
9
10
/**
11
 * QuestionTest
12
 */
13
class QuestionTest extends \TYPO3\CMS\Core\Tests\UnitTestCase
14
{
15
16
    /**
17
     * @var Question
18
     */
19
    protected $fileDomainModelInstance;
20
21
    /**
22
     * Setup
23
     *
24
     * @return void
25
     */
26
    protected function setUp()
27
    {
28
        $this->fileDomainModelInstance = new Question();
29
    }
30
31
    /**
32
     * @test
33
     */
34
    public function titleCanBeSet()
35
    {
36
        $title = 'This is the title';
37
        $this->fileDomainModelInstance->setTitle($title);
38
        $this->assertEquals($title, $this->fileDomainModelInstance->getTitle());
39
    }
40
}
41