-
Notifications
You must be signed in to change notification settings - Fork 8
/
EnumTest.php
61 lines (50 loc) · 1020 Bytes
/
EnumTest.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
<?php
use AdamDBurton\Destiny2ApiClient\Enum\Enum;
use PHPUnit\Framework\TestCase;
class TestEnum extends Enum
{
const One = 1;
const Two = 2;
const Three = 3;
}
final class EnumTest extends TestCase
{
public function testGetEnums()
{
$expected = [
'One' => 1,
'Two' => 2,
'Three' => 3
];
$this->assertEquals($expected, TestEnum::getEnums());
}
public function testGetEnumStrings()
{
$expected = [
'One',
'Two',
'Three'
];
$this->assertEquals($expected, TestEnum::getEnumStrings());
}
public function testHasEnum()
{
$this->assertTrue(TestEnum::hasEnum(TestEnum::One));
}
public function testHasEnum2()
{
$this->assertFalse(TestEnum::hasEnum(999));
}
public function testGetEnumStringFor()
{
$this->assertEquals('Two', TestEnum::getEnumStringFor(TestEnum::Two));
}
public function testFetEnumStringsFor()
{
$expected = [
'Two',
'Three'
];
$this->assertEquals($expected, TestEnum::getEnumStringsFor([ TestEnum::Two, TestEnum::Three ]));
}
}