testInvalidAttributeNameThrowsException()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 11
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 5
nc 1
nop 0
dl 0
loc 11
rs 9.4285
c 0
b 0
f 0
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