1 | <?php |
||
19 | class PrimTest extends ZorkTest |
||
20 | { |
||
21 | const FLAGSIZEMAX = 36; |
||
22 | |||
23 | /** |
||
24 | * Test Itafroma\Zork\msetg(). |
||
25 | * |
||
26 | * @covers ::Itafroma\Zork\msetg |
||
27 | * @dataProvider propertyProvider |
||
28 | */ |
||
29 | public function testMsetg($property_key, $property_value) |
||
36 | |||
37 | /** |
||
38 | * Test Itafroma\Zork\msetg() with extant key using the same value. |
||
39 | * |
||
40 | * @covers ::Itafroma\Zork\msetg |
||
41 | * @dataProvider propertyProvider |
||
42 | */ |
||
43 | public function testMsetgExtantKeySameValue($property_key, $property_value) |
||
54 | |||
55 | /** |
||
56 | * Test Itafroma\Zork\msetg() with extant key using a different value. |
||
57 | * |
||
58 | * @covers ::Itafroma\Zork\msetg |
||
59 | * @dataProvider propertyProvider |
||
60 | * @expectedException Itafroma\Zork\Exception\ConstantAlreadyDefinedException |
||
61 | */ |
||
62 | public function testMsetgExtantKeyDifferentValue($property_key, $property_value1, $property_value2) |
||
67 | |||
68 | /** |
||
69 | * Test Itafroma\Zork\psetg(). |
||
70 | * |
||
71 | * @covers ::Itafroma\Zork\psetg |
||
72 | * @dataProvider propertyProvider |
||
73 | */ |
||
74 | public function testPsetg($property_key, $property_value) |
||
81 | |||
82 | /** |
||
83 | * Test Itafroma\Zork\psetg() with extant key. |
||
84 | * |
||
85 | * @covers ::Itafroma\Zork\psetg |
||
86 | * @dataProvider propertyProvider |
||
87 | */ |
||
88 | public function testPsetgExtantKey($property_key, $property_value1, $property_value2) |
||
97 | |||
98 | /** |
||
99 | * Test Itafroma\Zork\psetg() with extant key and PURE-CAREFUL set. |
||
100 | * |
||
101 | * @covers ::Itafroma\Zork\psetg |
||
102 | * @dataProvider propertyProvider |
||
103 | * @expectedException Itafroma\Zork\Exception\PsetgDuplicateException |
||
104 | */ |
||
105 | public function testPsetgExtantKeyWithPureCareful($property_key, $property_value1, $property_value2) |
||
114 | |||
115 | /** |
||
116 | * Test Itafroma\Zork\flagword(). |
||
117 | * |
||
118 | * @covers ::Itafroma\Zork\flagword |
||
119 | * @dataProvider flagProvider |
||
120 | */ |
||
121 | public function testFlagword($flags) |
||
133 | |||
134 | /** |
||
135 | * Test Itafroam\Zork\flagword() when GROUP-GLUE flag is set. |
||
136 | * |
||
137 | * @covers ::Itafroma\Zork\flagword |
||
138 | * @dataProvider flagProvider |
||
139 | */ |
||
140 | public function testFlagwordGroupGlueEnabled($flags) |
||
154 | |||
155 | /** |
||
156 | * Test Itafroma\Zork\flagword() with too many flags. |
||
157 | * |
||
158 | * @covers ::Itafroma\Zork\flagword |
||
159 | * @dataProvider flagOverflowProvider |
||
160 | * @expectedException Itafroma\Zork\Exception\FlagwordException |
||
161 | */ |
||
162 | public function testFlagwordOverflow($flags) |
||
166 | |||
167 | /** |
||
168 | * Test Itafroma\Zork\newstruc(). |
||
169 | * |
||
170 | * @covers ::Itafroma\Zork\newstruc |
||
171 | * @expectedException \BadFunctionCallException |
||
172 | */ |
||
173 | public function testNewstruc() |
||
177 | |||
178 | /** |
||
179 | * Test Itafroma\Zork\make_slot() slot creation. |
||
180 | * |
||
181 | * @covers ::Itafroma\Zork\make_slot |
||
182 | * @dataProvider propertyProvider |
||
183 | */ |
||
184 | public function testMakeSlotCreate($property_key, $property_value) |
||
193 | |||
194 | /** |
||
195 | * Test Itafroma\Zork\make_slot() creation on an already-bound name. |
||
196 | * |
||
197 | * @covers ::Itafroma\Zork\make_slot |
||
198 | * @dataProvider propertyProvider |
||
199 | * @expectedException Itafroma\Zork\Exception\SlotNameAlreadyUsedException |
||
200 | */ |
||
201 | public function testMakeSlotCreateDuplicate($property_key, $property_value) |
||
206 | |||
207 | /** |
||
208 | * Test Itafroma\Zork\make_slot() slot write. |
||
209 | * |
||
210 | * @covers ::Itafroma\Zork\make_slot |
||
211 | * @dataProvider objectPropertyProvider |
||
212 | */ |
||
213 | public function testMakeSlotWrite($struc, $property_key, $property_value) |
||
221 | |||
222 | /** |
||
223 | * Test Itafroma\Zork\make_slot() slot read. |
||
224 | * |
||
225 | * @covers ::Itafroma\Zork\make_slot |
||
226 | * @dataProvider objectPropertyProvider |
||
227 | */ |
||
228 | public function testMakeSlotRead($struc, $property_key, $property_value) |
||
236 | |||
237 | /** |
||
238 | * Generate a list of flags for a bit field. |
||
239 | * |
||
240 | * @param int $size The size of the bit field. |
||
241 | * @return array The generated list of flags. |
||
242 | */ |
||
243 | protected function generateFlags($size) |
||
254 | |||
255 | /** |
||
256 | * Provide a list of flags up to the maximum bit field size. |
||
257 | */ |
||
258 | public function flagProvider() |
||
262 | |||
263 | /** |
||
264 | * Provide a list of flags beyond the maximum bit field size. |
||
265 | */ |
||
266 | public function flagOverflowProvider() |
||
270 | } |
||
271 |