1 | <?php |
||
56 | class UrlTest extends AbstractDisabledAutoconnectorTest |
||
57 | { |
||
58 | /** |
||
59 | * Example query fragment |
||
60 | * |
||
61 | * @var string |
||
62 | */ |
||
63 | const QUERY_FRAGMENT = '?param=value#fragment'; |
||
64 | /** |
||
65 | * Repository URL |
||
66 | * |
||
67 | * @var string |
||
68 | */ |
||
69 | const REPOSITORY_URL = '/repo'; |
||
70 | /** |
||
71 | * Example path |
||
72 | * |
||
73 | * @var string |
||
74 | */ |
||
75 | const PATH = '/2015/10/01/36704.event/36704-1'; |
||
76 | /** |
||
77 | * Example URL |
||
78 | * |
||
79 | * @var string |
||
80 | */ |
||
81 | const URL = self::REPOSITORY_URL.self::PATH.self::QUERY_FRAGMENT; |
||
82 | /** |
||
83 | * Example remote repository URL |
||
84 | * |
||
85 | * @var string |
||
86 | */ |
||
87 | const REMOTE_REPOSITORY_URL = 'http://apparat:[email protected]:80'; |
||
88 | /** |
||
89 | * Example remote URL |
||
90 | * |
||
91 | * @var string |
||
92 | */ |
||
93 | const REMOTE_URL = self::REMOTE_REPOSITORY_URL.self::PATH.self::QUERY_FRAGMENT; |
||
94 | /** |
||
95 | * Example apparat URL |
||
96 | * |
||
97 | * @var string |
||
98 | */ |
||
99 | const APPARAT_URL = 'aprts://apparat:[email protected]:80'.self::PATH.self::QUERY_FRAGMENT; |
||
100 | |||
101 | /** |
||
102 | * Test an URL |
||
103 | * |
||
104 | * @expectedException \Apparat\Object\Domain\Model\Path\InvalidArgumentException |
||
105 | * @expectedExceptionCode 1451515385 |
||
106 | */ |
||
107 | public function testInvalidRemoteUrl() |
||
111 | |||
112 | /** |
||
113 | * Test an URL |
||
114 | */ |
||
115 | public function testRemoteUrl() |
||
138 | |||
139 | /** |
||
140 | * Test a local URL with path prefix |
||
141 | */ |
||
142 | public function testLeadedLocalUrl() |
||
149 | |||
150 | /** |
||
151 | * Test an invalid URL |
||
152 | * |
||
153 | * @expectedException \Apparat\Object\Domain\Model\Path\InvalidArgumentException |
||
154 | * @expectedExceptionCode 1449873819 |
||
155 | */ |
||
156 | public function testInvalidUrl() |
||
160 | |||
161 | /** |
||
162 | * Test an invalid URL path |
||
163 | * |
||
164 | * @expectedException \Apparat\Object\Domain\Model\Path\InvalidArgumentException |
||
165 | * @expectedExceptionCode 1449874494 |
||
166 | */ |
||
167 | public function testInvalidUrlPath() |
||
171 | |||
172 | /** |
||
173 | * Test the scheme setter |
||
174 | * |
||
175 | * @expectedException \Apparat\Object\Domain\Model\Path\InvalidArgumentException |
||
176 | * @expectedExceptionCode 1449924914 |
||
177 | */ |
||
178 | public function testUrlSchemeSetter() |
||
184 | |||
185 | /** |
||
186 | * Test the host setter |
||
187 | * |
||
188 | * @expectedException \Apparat\Object\Domain\Model\Path\InvalidArgumentException |
||
189 | * @expectedExceptionCode 1449925567 |
||
190 | */ |
||
191 | public function testUrlHostSetter() |
||
197 | |||
198 | /** |
||
199 | * Test the port setter |
||
200 | * |
||
201 | * @expectedException \Apparat\Object\Domain\Model\Path\InvalidArgumentException |
||
202 | * @expectedExceptionCode 1449925885 |
||
203 | */ |
||
204 | public function testUrlPortSetter() |
||
210 | |||
211 | /** |
||
212 | * Test the remaining setter methods |
||
213 | */ |
||
214 | public function testUrlSetters() |
||
236 | |||
237 | /** |
||
238 | * Test the override functionality when getting the URL path |
||
239 | */ |
||
240 | public function testUrlPathOverride() |
||
248 | |||
249 | /** |
||
250 | * Test absolute URL |
||
251 | */ |
||
252 | public function testUrlAbsolute() |
||
258 | |||
259 | /** |
||
260 | * Test absolute URL |
||
261 | */ |
||
262 | public function testUrlAbsoluteLocal() |
||
267 | |||
268 | /** |
||
269 | * Test relative URL |
||
270 | */ |
||
271 | public function testUrlRelative() |
||
276 | |||
277 | /** |
||
278 | * Test remote URL |
||
279 | */ |
||
280 | public function testUrlRemote() |
||
287 | |||
288 | /** |
||
289 | * Test URL comparison |
||
290 | */ |
||
291 | public function testUrlComparison() |
||
303 | |||
304 | /** |
||
305 | * Test object URL comparison |
||
306 | */ |
||
307 | public function testObjectUrlComparison() |
||
351 | |||
352 | /** |
||
353 | * Test an invalid apparat URL |
||
354 | * |
||
355 | * @expectedException \Apparat\Object\Domain\Model\Path\InvalidArgumentException |
||
356 | * @expectedExceptionCode 1451435429 |
||
357 | */ |
||
358 | public function testInvalidApparatUrl() |
||
362 | |||
363 | /** |
||
364 | * Test an absolute apparat URL |
||
365 | */ |
||
366 | public function testAbsoluteApparatUrl() |
||
372 | |||
373 | /** |
||
374 | * Test an unknown relative apparat URL |
||
375 | * |
||
376 | * @expectedException \Apparat\Object\Domain\Model\Path\ApparatInvalidArgumentException |
||
377 | * @expectedExceptionCode 1452695654 |
||
378 | */ |
||
379 | public function testUnknownRelativeApparatUrl() |
||
383 | |||
384 | /** |
||
385 | * Test a relative apparat URL |
||
386 | */ |
||
387 | public function testRelativeApparatUrl() |
||
400 | |||
401 | /** |
||
402 | * Test invalid date precision |
||
403 | * |
||
404 | * @expectedException \Apparat\Object\Domain\Model\Path\InvalidArgumentException |
||
405 | * @expectedExceptionCode 1451514114 |
||
406 | */ |
||
407 | public function testInvalidDatePrecision() |
||
411 | |||
412 | /** |
||
413 | * Test arbitrary date precision |
||
414 | */ |
||
415 | public function testArbitraryDatePrecision() |
||
420 | |||
421 | /** |
||
422 | * Test the normalization of an invalid repository URL |
||
423 | * |
||
424 | * @expectedException \Apparat\Object\Domain\Repository\InvalidArgumentException |
||
425 | * @expectedExceptionCode 1453097878 |
||
426 | */ |
||
427 | public function testInvalidRepositoryUrlNormalization() |
||
431 | |||
432 | /** |
||
433 | * Test the normalization of a local string repository URL |
||
434 | */ |
||
435 | public function testLocalStringUrlNormalization() |
||
439 | } |
||
440 |
Methods can only be called on objects. This check looks for methods being called on variables that have been inferred to never be objects.