Completed
Push — master ( 2e664e...522f88 )
by Siad
14:25
created

DescriptionTest   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 20
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 8
dl 0
loc 20
rs 10
c 1
b 0
f 0
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A test() 0 4 1
A getFiles() 0 7 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
class DescriptionTest extends BuildFileTest
21
{
22
    /**
23
     * Test that the aaddText method appends text to description w/o any spaces
24
     *
25
     * @dataProvider getFiles
26
     */
27
    public function test($fileName, $outcome)
28
    {
29
        $this->configureProject(PHING_TEST_BASE . "/etc/types/{$fileName}.xml");
30
        $this->assertEquals($outcome, $this->getProject()->getDescription());
31
    }
32
33
    public function getFiles()
34
    {
35
        return [
36
            'Single' => ['description1', 'Test Project Description'],
37
            'Multi line' => ['description2', "Multi Line\nProject Description"],
38
            'Multi instance' => ['description3', 'Multi Instance Project Description'],
39
            'Multi instance nested' => ['description4', 'Multi Instance Nested Project Description'],
40
        ];
41
    }
42
}
43