Passed
Push — master ( 972120...1c77fc )
by Michiel
08:19
created

EchoTaskTest   A

Complexity

Total Complexity 8

Size/Duplication

Total Lines 53
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 21
dl 0
loc 53
rs 10
c 0
b 0
f 0
wmc 8

8 Methods

Rating   Name   Duplication   Size   Complexity  
A testFileset() 0 4 1
A testFilesetMsg() 0 5 1
A testDirset() 0 6 1
A testPropertyMsg() 0 4 1
A setUp() 0 4 1
A testFilesetInline() 0 5 1
A testPropertyMessage() 0 4 1
A testInlineText() 0 4 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\Tasks\System;
21
22
use Phing\Support\BuildFileTest;
23
24
/**
25
 * Tests the Echo Task
26
 *
27
 * @author  Christian Weiske <[email protected]>
28
 * @package phing.tasks.system
29
 */
30
class EchoTaskTest extends BuildFileTest
31
{
32
    public function setUp(): void
33
    {
34
        $this->configureProject(
35
            PHING_TEST_BASE . '/etc/tasks/system/EchoTest.xml'
36
        );
37
    }
38
39
    public function testPropertyMsg()
40
    {
41
        $this->executeTarget(__FUNCTION__);
42
        $this->assertInLogs('This is a msg');
43
    }
44
45
    public function testPropertyMessage()
46
    {
47
        $this->executeTarget(__FUNCTION__);
48
        $this->assertInLogs('This is a message');
49
    }
50
51
    public function testInlineText()
52
    {
53
        $this->executeTarget(__FUNCTION__);
54
        $this->assertInLogs('This is a nested inline text message');
55
    }
56
57
    public function testFileset()
58
    {
59
        $this->executeTarget(__FUNCTION__);
60
        $this->assertInLogs('EchoTest.xml');
61
    }
62
63
    public function testDirset()
64
    {
65
        $this->executeTarget(__FUNCTION__);
66
        $this->assertInLogs('ext');
67
        $this->assertInLogs('imports');
68
        $this->assertInLogs('system');
69
    }
70
71
    public function testFilesetInline()
72
    {
73
        $this->executeTarget(__FUNCTION__);
74
        $this->assertInLogs('foo');
75
        $this->assertInLogs('EchoTest.xml');
76
    }
77
78
    public function testFilesetMsg()
79
    {
80
        $this->executeTarget(__FUNCTION__);
81
        $this->assertInLogs("foo\n");
82
        $this->assertInLogs('EchoTest.xml');
83
    }
84
}
85