Completed
Push — master ( 097411...81da4d )
by Jefersson
13s queued 11s
created

FilterAggregatorTest   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 21
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Importance

Changes 0
Metric Value
wmc 2
lcom 0
cbo 2
dl 0
loc 21
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A it_should_have_replace_current_year_placeholder_as_default_filter() 0 4 1
A it_should_apply_default_filters_to_given_docheader() 0 7 1
1
<?php
2
3
declare(strict_types=1);
4
5
/*
6
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
7
 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
8
 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
9
 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
10
 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
11
 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
12
 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
13
 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
14
 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
15
 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
16
 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
17
 *
18
 * This software consists of voluntary contributions made by many individuals
19
 * and is licensed under the MIT license.
20
 */
21
namespace DocHeaderTest\Filter;
22
23
use DocHeader\Filter\FilterAggregator;
24
use PHPUnit\Framework\TestCase;
25
use function date;
26
27
/**
28
 * Tests for {@see \DocHeader\Filter\FilterAggregator}.
29
 *
30
 * @group   Unitary
31
 * @covers  \DocHeader\Filter\FilterAggregator
32
 */
33
final class FilterAggregatorTest extends TestCase
34
{
35
    /**
36
     * @test
37
     */
38
    public function it_should_have_replace_current_year_placeholder_as_default_filter() : void
39
    {
40
        $this->assertClassHasAttribute('dockBlockDefaultFilters', FilterAggregator::class);
41
    }
42
43
    /**
44
     * @test
45
     */
46
    public function it_should_apply_default_filters_to_given_docheader() : void
47
    {
48
        $docBlock = 'Year %year%';
49
        $filter   = new FilterAggregator($docBlock);
50
51
        $this->assertSame('Year ' . date('Y'), $filter->apply());
52
    }
53
}
54