Completed
Branch master (4042af)
by Aleksandar
02:14
created

ArticleFilterTest   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 20
Duplicated Lines 100 %

Coupling/Cohesion

Components 0
Dependencies 3

Importance

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

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
declare(strict_types=1);
4
5
namespace Article\Test\Filter;
6
7
class ArticleFilterTest extends \PHPUnit_Framework_TestCase
8
{
9
    public function testGetInputFilterShouldReturnExpectedInstance()
10
    {
11
        $articleFilter = new \Article\Filter\ArticleFilter();
12
        static::assertInstanceOf(\Zend\InputFilter\InputFilter::class, $articleFilter->getInputFilter());
13
    }
14
15
    /**
16
     * @expectedException \Exception
17
     * @expectedExceptionMessage Not used
18
     */
19
    public function testSetInputShouldThrowException()
20
    {
21
        $inputInterface = $this->getMockBuilder(\Zend\InputFilter\InputFilterInterface::class)
22
            ->getMockForAbstractClass();
23
        $articleFilter = new \Article\Filter\ArticleFilter();
24
        $articleFilter->setInputFilter($inputInterface);
25
    }
26
}
27