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

SerializationTest::testIntrospectKeys()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 8
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 8
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 5
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\Serialization;
14
use SimplePie\Test\Unit\AbstractTestCase;
15
16
/**
17
 * @coversNothing
18
 */
19
class SerializationTest extends AbstractTestCase
20
{
21
    public function testIntrospect(): void
22
    {
23
        $this->assertSame(Serialization::introspect(), [
24
            'TEXT'  => 'text',
25
            'HTML'  => 'html',
26
            'XHTML' => 'xhtml',
27
        ]);
28
    }
29
30
    public function testIntrospectKeys(): void
31
    {
32
        $this->assertSame(Serialization::introspectKeys(), [
33
            'TEXT',
34
            'HTML',
35
            'XHTML',
36
        ]);
37
    }
38
39
    public function testHasValue(): void
40
    {
41
        $this->assertTrue(Serialization::hasValue(Serialization::TEXT));
42
        $this->assertTrue(Serialization::hasValue(Serialization::HTML));
43
        $this->assertTrue(Serialization::hasValue(Serialization::XHTML));
44
45
        $this->assertFalse(Serialization::hasValue('nope'));
46
    }
47
}
48