Completed
Branch master (95b3ba)
by Ryan
28:02 queued 13:03
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
class SerializationTest extends AbstractTestCase
17
{
18
    public function testIntrospect(): void
19
    {
20
        $this->assertSame(Serialization::introspect(), [
21
            'TEXT'  => 'text',
22
            'HTML'  => 'html',
23
            'XHTML' => 'xhtml',
24
        ]);
25
    }
26
27
    public function testIntrospectKeys(): void
28
    {
29
        $this->assertSame(Serialization::introspectKeys(), [
30
            'TEXT',
31
            'HTML',
32
            'XHTML',
33
        ]);
34
    }
35
36
    public function testHasValue(): void
37
    {
38
        $this->assertTrue(Serialization::hasValue(Serialization::TEXT));
39
        $this->assertTrue(Serialization::hasValue(Serialization::HTML));
40
        $this->assertTrue(Serialization::hasValue(Serialization::XHTML));
41
42
        $this->assertFalse(Serialization::hasValue('nope'));
43
    }
44
}
45