1 | <?php |
||
58 | class RepositoryTest extends AbstractTest |
||
59 | { |
||
60 | /** |
||
61 | * Temporary glob directory |
||
62 | * |
||
63 | * @var string |
||
64 | */ |
||
65 | protected static $_globBase = null; |
||
66 | /** |
||
67 | * Created temporary files |
||
68 | * |
||
69 | * @var array |
||
70 | */ |
||
71 | protected static $_globFiles = []; |
||
72 | /** |
||
73 | * Created temporary directories |
||
74 | * |
||
75 | * @var array |
||
76 | */ |
||
77 | protected static $_globDirs = []; |
||
78 | /** |
||
79 | * Type counter |
||
80 | * |
||
81 | * @var array |
||
82 | */ |
||
83 | protected static $_globTypes = ['event' => 0, 'article' => 0, 'note' => 0]; |
||
84 | /** |
||
85 | * Revision counter |
||
86 | * |
||
87 | * @var array |
||
88 | */ |
||
89 | protected static $_globRevisions = ['' => 0, '-0' => 0, '-1' => 0]; |
||
90 | |||
91 | /** |
||
92 | * Setup |
||
93 | */ |
||
94 | public static function setUpBeforeClass() |
||
151 | |||
152 | /** |
||
153 | * Teardown |
||
154 | */ |
||
155 | public static function tearDownAfterClass() |
||
167 | |||
168 | /** |
||
169 | * Test a bare URL with invalid schema |
||
170 | * |
||
171 | * @expectedException \RuntimeException |
||
172 | * @expectedExceptionCode 1451776352 |
||
173 | */ |
||
174 | public static function testInvalidSchemaBareUrl() |
||
178 | |||
179 | /** |
||
180 | * Test a bare URL with query |
||
181 | * |
||
182 | * @expectedException \RuntimeException |
||
183 | * @expectedExceptionCode 1451776509 |
||
184 | */ |
||
185 | public static function testInvalidQueryBareUrl() |
||
189 | |||
190 | /** |
||
191 | * Test a bare URL with fragment |
||
192 | * |
||
193 | * @expectedException \RuntimeException |
||
194 | * @expectedExceptionCode 1451776570 |
||
195 | */ |
||
196 | public static function testInvalidFragmentBareUrl() |
||
200 | |||
201 | /** |
||
202 | * Test disabling of repository auto-connection |
||
203 | */ |
||
204 | public function testUseAutoconnect() |
||
208 | |||
209 | /** |
||
210 | * Test invalid query repository URL registration |
||
211 | * |
||
212 | * @expectedException \Apparat\Object\Infrastructure\Repository\InvalidArgumentException |
||
213 | * @expectedExceptionCode 1451776509 |
||
214 | */ |
||
215 | public function testRegisterInvalidQueryRepositoryUrl() |
||
219 | |||
220 | /** |
||
221 | * Test invalid query repository URL registration |
||
222 | * |
||
223 | * @expectedException \Apparat\Object\Infrastructure\Repository\InvalidArgumentException |
||
224 | * @expectedExceptionCode 1451776509 |
||
225 | */ |
||
226 | public function testInstantiateInvalidQueryRepositoryUrl() |
||
237 | |||
238 | /** |
||
239 | * Test unknown public repository URL instantiation |
||
240 | * |
||
241 | * @expectedException \Apparat\Object\Infrastructure\Repository\InvalidArgumentException |
||
242 | * @expectedExceptionCode 1451771889 |
||
243 | */ |
||
244 | public function testInstantiateUnknownRepositoryUrl() |
||
248 | |||
249 | /** |
||
250 | * Test empty repository config |
||
251 | * |
||
252 | * @expectedException \Apparat\Object\Infrastructure\Factory\InvalidArgumentException |
||
253 | * @expectedExceptionCode 1449956347 |
||
254 | */ |
||
255 | public function testEmptyRepositoryConfig() |
||
259 | |||
260 | /** |
||
261 | * Test empty adapter strategy configuration |
||
262 | * |
||
263 | * @expectedException \Apparat\Object\Infrastructure\Factory\InvalidArgumentException |
||
264 | * @expectedExceptionCode 1449956347 |
||
265 | */ |
||
266 | public function testEmptyAdapterStrategyConfig() |
||
270 | |||
271 | /** |
||
272 | * Test invalid adapter strategy type |
||
273 | * |
||
274 | * @expectedException \Apparat\Object\Infrastructure\Factory\InvalidArgumentException |
||
275 | * @expectedExceptionCode 1449956471 |
||
276 | */ |
||
277 | public function testInvalidAdapterStrategyType() |
||
285 | |||
286 | /** |
||
287 | * Test file adapter strategy type |
||
288 | */ |
||
289 | public function testFileAdapterStrategy() |
||
300 | |||
301 | /** |
||
302 | * Test invalid file adapter strategy root |
||
303 | * |
||
304 | * @expectedException \Apparat\Object\Domain\Repository\InvalidArgumentException |
||
305 | * @expectedExceptionCode 1450136346 |
||
306 | */ |
||
307 | public function testMissingFileStrategyRoot() |
||
317 | |||
318 | /** |
||
319 | * Test empty file adapter strategy root |
||
320 | * |
||
321 | * @expectedException \Apparat\Object\Infrastructure\Repository\InvalidArgumentException |
||
322 | * @expectedExceptionCode 1449956977 |
||
323 | */ |
||
324 | public function testEmptyFileStrategyRoot() |
||
335 | |||
336 | /** |
||
337 | * Test invalid file adapter strategy root |
||
338 | * |
||
339 | * @expectedException \Apparat\Object\Infrastructure\Repository\InvalidArgumentException |
||
340 | * @expectedExceptionCode 1449957017 |
||
341 | */ |
||
342 | public function testInvalidFileStrategyRoot() |
||
353 | |||
354 | /** |
||
355 | * Test invalid repository URL during instantiation |
||
356 | * |
||
357 | * @expectedException \Apparat\Object\Domain\Repository\InvalidArgumentException |
||
358 | * @expectedExceptionCode 1451771889 |
||
359 | */ |
||
360 | public function testUnknownRepositoryUrlInstance() |
||
371 | |||
372 | /** |
||
373 | * Test file repository |
||
374 | */ |
||
375 | public function testFileRepository() |
||
393 | |||
394 | /** |
||
395 | * Test file repository with revisions |
||
396 | */ |
||
397 | public function testFileRepositoryRevisions() |
||
413 | |||
414 | /** |
||
415 | * Test a repository path |
||
416 | */ |
||
417 | public function testRepositoryPath() |
||
431 | } |
||
432 |