Array2XMLTest   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 32
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A testInvalidAttributeNameThrowsException() 0 11 1
A testInvalidSimpleTagNameThrowsException() 0 9 1
1
<?php
2
3
namespace LaLit;
4
5
class Array2XMLTest extends \PHPUnit_Framework_TestCase
6
{
7
    /**
8
     * @expectedException \Exception
9
     * @expectedExceptionMessage [Array2XML] Illegal character in attribute name. attribute: #attribute1 in node: root
10
     */
11
    public function testInvalidAttributeNameThrowsException()
12
    {
13
        Array2XML::createXML(
14
            'root',
15
            [
16
                '@attributes' => [
17
                        '#attribute1' => '',
18
                    ],
19
            ]
20
        );
21
    }
22
23
    /**
24
     * @expectedException \Exception
25
     * @expectedExceptionMessage [Array2XML] Illegal character in tag name. tag: #node in node: root
26
     */
27
    public function testInvalidSimpleTagNameThrowsException()
28
    {
29
        Array2XML::createXML(
30
            'root',
31
            [
32
                '#node' => 'bad node name',
33
            ]
34
        );
35
    }
36
}
37