Passed
Push — main ( 2c83d5...fb3f8a )
by Siad
05:21
created

TailFilterTest   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 30
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 4
eloc 11
dl 0
loc 30
rs 10
c 0
b 0
f 0

4 Methods

Rating   Name   Duplication   Size   Complexity  
A testTailHeadFilter() 0 8 1
A setUp() 0 3 1
A tearDown() 0 3 1
A testTailFilter() 0 8 1
1
<?php
2
/**
3
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
4
 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
5
 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
6
 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
7
 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
8
 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
9
 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
10
 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
11
 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
12
 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
13
 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
14
 *
15
 * This software consists of voluntary contributions made by many individuals
16
 * and is licensed under the LGPL. For more information please see
17
 * <http://phing.info>.
18
 */
19
20
namespace Phing\Test\Filter;
21
22
use Phing\Test\Support\BuildFileTest;
23
24
/**
25
 * @author  Siad Ardroumli <[email protected]>
26
 */
27
class TailFilterTest extends BuildFileTest
28
{
29
    public function setUp(): void
30
    {
31
        $this->configureProject(PHING_TEST_BASE . "/etc/filters/tailfilter.xml");
32
    }
33
34
    public function tearDown(): void
35
    {
36
        $this->executeTarget("cleanup");
37
    }
38
39
    public function testTailFilter()
40
    {
41
        $this->executeTarget(__FUNCTION__);
42
43
        $expected = $this->getProject()->resolveFile("expected/tailfilter.test");
44
        $result = $this->getProject()->resolveFile("result/tailfilter.test");
45
46
        $this->assertFileEquals($expected->getAbsolutePath(), $result->getAbsolutePath());
47
    }
48
49
    public function testTailHeadFilter()
50
    {
51
        $this->executeTarget(__FUNCTION__);
52
53
        $expected = $this->getProject()->resolveFile("expected/tailheadfilter.test");
54
        $result = $this->getProject()->resolveFile("result/tailfilter.test");
55
56
        $this->assertFileEquals($expected->getAbsolutePath(), $result->getAbsolutePath());
57
    }
58
}
59