Completed
Branch master (95b3ba)
by Ryan
28:02 queued 13:03
created

SerializationTest   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 29
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Importance

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

3 Methods

Rating   Name   Duplication   Size   Complexity  
A testIntrospect() 0 8 1
A testIntrospectKeys() 0 8 1
A testHasValue() 0 8 1
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