-
Notifications
You must be signed in to change notification settings - Fork 36
Expand file tree
/
Copy pathBoundaryValueTypeForCharTest.php
More file actions
147 lines (127 loc) Β· 4.26 KB
/
BoundaryValueTypeForCharTest.php
File metadata and controls
147 lines (127 loc) Β· 4.26 KB
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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
<?php
declare(strict_types=1);
namespace PHPJava\Tests\Cases;
class BoundaryValueTypeForCharTest extends Base
{
use \PHPJava\Tests\Helpers\MakeUnicodeChar;
use \PHPJava\Tests\Helpers\GetField;
use \PHPJava\Tests\Helpers\AssertionHelpers\AssertFields;
protected $fixtures = [
'BoundaryValueTypeForCharTest',
];
// TODO: Fix integer to char value
public function testStaticC0()
{
$this->assertStaticField(
$this->makeUnicodeChar(0x0000),
'c0'
);
}
public function testStaticC1()
{
$this->assertStaticField(
$this->makeUnicodeChar(0xFFFF),
'c1'
);
}
public function testStaticC2()
{
$this->assertStaticField(
$this->makeUnicodeChar(0x7FFF),
'c2'
);
}
public function testStaticC3()
{
$this->assertStaticField(
$this->makeUnicodeChar(0x8000),
'c3'
);
}
public function testStaticC4()
{
$this->assertStaticField(
$this->makeUnicodeChar(0x9123),
'c4'
);
}
public function testDynamicC0()
{
$this->assertDynamicField(
$this->makeUnicodeChar(0x0000),
'c0'
);
}
public function testDynamicC1()
{
$this->assertDynamicField(
$this->makeUnicodeChar(0xFFFF),
'c1'
);
}
public function testDynamicC2()
{
$this->assertDynamicField(
$this->makeUnicodeChar(0x7FFF),
'c2'
);
}
public function testDynamicC3()
{
$this->assertDynamicField(
$this->makeUnicodeChar(0x8000),
'c3'
);
}
public function testDynamicC4()
{
$this->assertDynamicField(
$this->makeUnicodeChar(0x9123),
'c4'
);
}
public function testStaticArrayChars()
{
$array = $this->getStaticField('s_a_c');
$this->assertCount(5, $array);
$this->assertEquals($this->makeUnicodeChar(0x0000), (string) $array[0]);
$this->assertEquals($this->makeUnicodeChar(0xFFFF), (string) $array[1]);
$this->assertEquals($this->makeUnicodeChar(0x7FFF), (string) $array[2]);
$this->assertEquals($this->makeUnicodeChar(0x8000), (string) $array[3]);
$this->assertEquals($this->makeUnicodeChar(0x9123), (string) $array[4]);
}
public function testDynamicArrayChars()
{
$array = $this->getDynamicField('d_a_c');
$this->assertCount(5, $array);
$this->assertEquals($this->makeUnicodeChar(0x0000), (string) $array[0]);
$this->assertEquals($this->makeUnicodeChar(0xFFFF), (string) $array[1]);
$this->assertEquals($this->makeUnicodeChar(0x7FFF), (string) $array[2]);
$this->assertEquals($this->makeUnicodeChar(0x8000), (string) $array[3]);
$this->assertEquals($this->makeUnicodeChar(0x9123), (string) $array[4]);
}
public function testStaticMultiDimensionArrayChars()
{
$array = $this->getStaticField('s_ma_c');
$this->assertCount(2, $array);
$this->assertCount(3, $array[0]);
$this->assertCount(2, $array[1]);
$this->assertEquals($this->makeUnicodeChar(0x0000), (string) $array[0][0]);
$this->assertEquals($this->makeUnicodeChar(0xFFFF), (string) $array[0][1]);
$this->assertEquals($this->makeUnicodeChar(0x7FFF), (string) $array[0][2]);
$this->assertEquals($this->makeUnicodeChar(0x8000), (string) $array[1][0]);
$this->assertEquals($this->makeUnicodeChar(0x9123), (string) $array[1][1]);
}
public function testDynamicMultiDimensionArrayChars()
{
$array = $this->getDynamicField('d_ma_c');
$this->assertCount(2, $array);
$this->assertCount(3, $array[0]);
$this->assertCount(2, $array[1]);
$this->assertEquals($this->makeUnicodeChar(0x0000), (string) $array[0][0]);
$this->assertEquals($this->makeUnicodeChar(0xFFFF), (string) $array[0][1]);
$this->assertEquals($this->makeUnicodeChar(0x7FFF), (string) $array[0][2]);
$this->assertEquals($this->makeUnicodeChar(0x8000), (string) $array[1][0]);
$this->assertEquals($this->makeUnicodeChar(0x9123), (string) $array[1][1]);
}
}