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

CharacterSetTest   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 32
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Importance

Changes 0
Metric Value
wmc 3
lcom 0
cbo 2
dl 0
loc 32
rs 10
c 0
b 0
f 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\CharacterSet;
14
use SimplePie\Test\Unit\AbstractTestCase;
15
16
/**
17
 * @coversNothing
18
 */
19
class CharacterSetTest extends AbstractTestCase
20
{
21
    public function testIntrospect(): void
22
    {
23
        $this->assertSame(CharacterSet::introspect(), [
24
            'ISO_8859_1' => 'iso-8859-1',
25
            'US_ASCII'   => 'us-ascii',
26
            'UTF_8'      => 'utf-8',
27
            'WIN_1252'   => 'windows-1252',
28
        ]);
29
    }
30
31
    public function testIntrospectKeys(): void
32
    {
33
        $this->assertSame(CharacterSet::introspectKeys(), [
34
            'ISO_8859_1',
35
            'US_ASCII',
36
            'UTF_8',
37
            'WIN_1252',
38
        ]);
39
    }
40
41
    public function testHasValue(): void
42
    {
43
        $this->assertTrue(CharacterSet::hasValue(CharacterSet::ISO_8859_1));
44
        $this->assertTrue(CharacterSet::hasValue(CharacterSet::US_ASCII));
45
        $this->assertTrue(CharacterSet::hasValue(CharacterSet::UTF_8));
46
        $this->assertTrue(CharacterSet::hasValue(CharacterSet::WIN_1252));
47
48
        $this->assertFalse(CharacterSet::hasValue('nope'));
49
    }
50
}
51