Passed
Push — master ( bf1af5...e52ce1 )
by Ryan
14:07
created

XmlNsTest::testIntrospect()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 13
Code Lines 10

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 13
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 10
nc 1
nop 0
1
<?php
2
/**
3
 * Copyright (c) 2017 Ryan Parman <http://ryanparman.com>.
4
 * Copyright (c) 2017 Contributors.
5
 *
6
 * http://opensource.org/licenses/Apache2.0
7
 */
8
9
declare(strict_types=1);
10
11
namespace SimplePie\Test\Unit\Enum;
12
13
use SimplePie\Enum\XmlNs;
14
use SimplePie\Test\Unit\AbstractTestCase;
15
16
/**
17
 * @coversNothing
18
 */
19
class XmlNsTest extends AbstractTestCase
20
{
21
    public function testIntrospect(): void
22
    {
23
        $this->assertSame(XmlNs::introspect(), [
24
            'ATOM_03' => 'http://purl.org/atom/ns#',
25
            'ATOM_10' => 'http://www.w3.org/2005/Atom',
26
            'RDF'     => 'http://www.w3.org/1999/02/22-rdf-syntax-ns#',
27
            'RSS_090' => 'http://my.netscape.com/rdf/simple/0.9/',
28
            'RSS_10'  => 'http://purl.org/rss/1.0/',
29
            'RSS_20'  => '',
30
            'XHTML'   => 'http://www.w3.org/1999/xhtml',
31
            'XML'     => 'http://www.w3.org/XML/1998/namespace',
32
        ]);
33
    }
34
35
    public function testIntrospectKeys(): void
36
    {
37
        $this->assertSame(XmlNs::introspectKeys(), [
38
            'ATOM_03',
39
            'ATOM_10',
40
            'RDF',
41
            'RSS_090',
42
            'RSS_10',
43
            'RSS_20',
44
            'XHTML',
45
            'XML',
46
        ]);
47
    }
48
49
    public function testHasValue(): void
50
    {
51
        $this->assertTrue(XmlNs::hasValue(XmlNs::ATOM_03));
52
        $this->assertTrue(XmlNs::hasValue(XmlNs::ATOM_10));
53
        $this->assertTrue(XmlNs::hasValue(XmlNs::RDF));
54
        $this->assertTrue(XmlNs::hasValue(XmlNs::RSS_090));
55
        $this->assertTrue(XmlNs::hasValue(XmlNs::RSS_10));
56
        $this->assertTrue(XmlNs::hasValue(XmlNs::RSS_20));
57
        $this->assertTrue(XmlNs::hasValue(XmlNs::XHTML));
58
        $this->assertTrue(XmlNs::hasValue(XmlNs::XML));
59
60
        $this->assertFalse(XmlNs::hasValue('nope'));
61
    }
62
}
63