Passed
Push — master ( 2d2c6c...f5ddaa )
by Siad
10:55
created

StripPhpCommentsTest::testStripPhpComments()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 11
Code Lines 6

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 6
c 1
b 0
f 0
nc 1
nop 0
dl 0
loc 11
rs 10
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
/**
21
 * @author  Michiel Rook <[email protected]>
22
 * @package phing.filters
23
 */
24
class StripPhpCommentsTest extends BuildFileTest
25
{
26
    /**
27
     * @var FileUtils
28
     */
29
    protected $fu;
30
31
    public function setUp(): void
32
    {
33
        $this->configureProject(PHING_TEST_BASE . "/etc/filters/stripphpcomments.xml");
34
        $this->fu = new FileUtils();
35
    }
36
37
    public function tearDown(): void
38
    {
39
        $this->executeTarget("cleanup");
40
    }
41
42
    public function testStripPhpComments()
43
    {
44
        $this->executeTarget(__FUNCTION__);
45
46
        $expectedFile = $this->getProject()->resolveFile("expected/stripphpcomments.test");
47
        $resultFile = $this->getProject()->resolveFile("result/stripphpcomments.test");
48
49
        $expected = file_get_contents($expectedFile->getAbsolutePath());
50
        $result = file_get_contents($resultFile->getAbsolutePath());
51
52
        $this->assertEquals($expected, $result, "Files don't match!");
53
    }
54
}
55