Complex classes like UriTest often do a lot of different things. To break such a class down, we need to identify a cohesive component within that class. A common approach to find such a component is to look for fields/methods that share the same prefixes, or suffixes. You can also have a look at the cohesion graph to spot any un-connected, or weakly-connected components.
Once you have determined the fields that belong together, you can apply the Extract Class refactoring. If the component makes sense as a sub-class, Extract Subclass is also a candidate, and is often faster.
While breaking up the class, it is a good idea to analyze how other classes use UriTest, and based on these observations, apply Extract Interface, too.
1 | <?php |
||
8 | class UriTest extends TestCase |
||
9 | { |
||
10 | /** |
||
11 | * @covers \OAuth\Common\Http\Uri\Uri::__construct |
||
12 | */ |
||
13 | public function testConstructCorrectInterfaceWithoutUri(): void |
||
19 | |||
20 | /** |
||
21 | * @covers \OAuth\Common\Http\Uri\Uri::__construct |
||
22 | * @covers \OAuth\Common\Http\Uri\Uri::parseUri |
||
23 | */ |
||
24 | public function testConstructThrowsExceptionOnInvalidUri(): void |
||
31 | |||
32 | /** |
||
33 | * @covers \OAuth\Common\Http\Uri\Uri::__construct |
||
34 | * @covers \OAuth\Common\Http\Uri\Uri::parseUri |
||
35 | */ |
||
36 | public function testConstructThrowsExceptionOnUriWithoutScheme(): void |
||
42 | |||
43 | /** |
||
44 | * @covers \OAuth\Common\Http\Uri\Uri::__construct |
||
45 | * @covers \OAuth\Common\Http\Uri\Uri::getScheme |
||
46 | * @covers \OAuth\Common\Http\Uri\Uri::parseUri |
||
47 | */ |
||
48 | public function testGetScheme(): void |
||
54 | |||
55 | /** |
||
56 | * @covers \OAuth\Common\Http\Uri\Uri::__construct |
||
57 | * @covers \OAuth\Common\Http\Uri\Uri::getUserInfo |
||
58 | * @covers \OAuth\Common\Http\Uri\Uri::parseUri |
||
59 | * @covers \OAuth\Common\Http\Uri\Uri::protectUserInfo |
||
60 | * @covers \OAuth\Common\Http\Uri\Uri::setUserInfo |
||
61 | */ |
||
62 | public function testGetUserInfo(): void |
||
68 | |||
69 | /** |
||
70 | * @covers \OAuth\Common\Http\Uri\Uri::__construct |
||
71 | * @covers \OAuth\Common\Http\Uri\Uri::getUserInfo |
||
72 | * @covers \OAuth\Common\Http\Uri\Uri::parseUri |
||
73 | * @covers \OAuth\Common\Http\Uri\Uri::protectUserInfo |
||
74 | * @covers \OAuth\Common\Http\Uri\Uri::setUserInfo |
||
75 | */ |
||
76 | public function testGetUserInfoWithPass(): void |
||
82 | |||
83 | /** |
||
84 | * @covers \OAuth\Common\Http\Uri\Uri::__construct |
||
85 | * @covers \OAuth\Common\Http\Uri\Uri::getRawUserInfo |
||
86 | * @covers \OAuth\Common\Http\Uri\Uri::parseUri |
||
87 | * @covers \OAuth\Common\Http\Uri\Uri::protectUserInfo |
||
88 | * @covers \OAuth\Common\Http\Uri\Uri::setUserInfo |
||
89 | */ |
||
90 | public function testGetRawUserInfo(): void |
||
96 | |||
97 | /** |
||
98 | * @covers \OAuth\Common\Http\Uri\Uri::__construct |
||
99 | * @covers \OAuth\Common\Http\Uri\Uri::getRawUserInfo |
||
100 | * @covers \OAuth\Common\Http\Uri\Uri::parseUri |
||
101 | * @covers \OAuth\Common\Http\Uri\Uri::protectUserInfo |
||
102 | * @covers \OAuth\Common\Http\Uri\Uri::setUserInfo |
||
103 | */ |
||
104 | public function testGetRawUserInfoWithPass(): void |
||
110 | |||
111 | /** |
||
112 | * @covers \OAuth\Common\Http\Uri\Uri::__construct |
||
113 | * @covers \OAuth\Common\Http\Uri\Uri::getHost |
||
114 | * @covers \OAuth\Common\Http\Uri\Uri::parseUri |
||
115 | */ |
||
116 | public function testGetHost(): void |
||
122 | |||
123 | /** |
||
124 | * @covers \OAuth\Common\Http\Uri\Uri::__construct |
||
125 | * @covers \OAuth\Common\Http\Uri\Uri::getPort |
||
126 | * @covers \OAuth\Common\Http\Uri\Uri::parseUri |
||
127 | */ |
||
128 | public function testGetPortImplicitHttp(): void |
||
134 | |||
135 | /** |
||
136 | * @covers \OAuth\Common\Http\Uri\Uri::__construct |
||
137 | * @covers \OAuth\Common\Http\Uri\Uri::getPort |
||
138 | * @covers \OAuth\Common\Http\Uri\Uri::parseUri |
||
139 | */ |
||
140 | public function testGetPortImplicitHttps(): void |
||
146 | |||
147 | /** |
||
148 | * @covers \OAuth\Common\Http\Uri\Uri::__construct |
||
149 | * @covers \OAuth\Common\Http\Uri\Uri::getPort |
||
150 | * @covers \OAuth\Common\Http\Uri\Uri::parseUri |
||
151 | */ |
||
152 | public function testGetPortExplicit(): void |
||
158 | |||
159 | /** |
||
160 | * @covers \OAuth\Common\Http\Uri\Uri::__construct |
||
161 | * @covers \OAuth\Common\Http\Uri\Uri::getPath |
||
162 | * @covers \OAuth\Common\Http\Uri\Uri::parseUri |
||
163 | */ |
||
164 | public function testGetPathNotSupplied(): void |
||
170 | |||
171 | /** |
||
172 | * @covers \OAuth\Common\Http\Uri\Uri::__construct |
||
173 | * @covers \OAuth\Common\Http\Uri\Uri::getPath |
||
174 | * @covers \OAuth\Common\Http\Uri\Uri::parseUri |
||
175 | */ |
||
176 | public function testGetPathSlash(): void |
||
182 | |||
183 | /** |
||
184 | * @covers \OAuth\Common\Http\Uri\Uri::__construct |
||
185 | * @covers \OAuth\Common\Http\Uri\Uri::getPath |
||
186 | * @covers \OAuth\Common\Http\Uri\Uri::parseUri |
||
187 | */ |
||
188 | public function testGetPath(): void |
||
194 | |||
195 | /** |
||
196 | * @covers \OAuth\Common\Http\Uri\Uri::__construct |
||
197 | * @covers \OAuth\Common\Http\Uri\Uri::getQuery |
||
198 | * @covers \OAuth\Common\Http\Uri\Uri::parseUri |
||
199 | */ |
||
200 | public function testGetQueryWithParams(): void |
||
206 | |||
207 | /** |
||
208 | * @covers \OAuth\Common\Http\Uri\Uri::__construct |
||
209 | * @covers \OAuth\Common\Http\Uri\Uri::getQuery |
||
210 | * @covers \OAuth\Common\Http\Uri\Uri::parseUri |
||
211 | */ |
||
212 | public function testGetQueryWithoutParams(): void |
||
218 | |||
219 | /** |
||
220 | * @covers \OAuth\Common\Http\Uri\Uri::__construct |
||
221 | * @covers \OAuth\Common\Http\Uri\Uri::getFragment |
||
222 | * @covers \OAuth\Common\Http\Uri\Uri::parseUri |
||
223 | */ |
||
224 | public function testGetFragmentExists(): void |
||
230 | |||
231 | /** |
||
232 | * @covers \OAuth\Common\Http\Uri\Uri::__construct |
||
233 | * @covers \OAuth\Common\Http\Uri\Uri::getFragment |
||
234 | * @covers \OAuth\Common\Http\Uri\Uri::parseUri |
||
235 | */ |
||
236 | public function testGetFragmentNotExists(): void |
||
242 | |||
243 | /** |
||
244 | * @covers \OAuth\Common\Http\Uri\Uri::__construct |
||
245 | * @covers \OAuth\Common\Http\Uri\Uri::getAuthority |
||
246 | * @covers \OAuth\Common\Http\Uri\Uri::parseUri |
||
247 | */ |
||
248 | public function testGetAuthorityWithoutUserInfo(): void |
||
254 | |||
255 | /** |
||
256 | * @covers \OAuth\Common\Http\Uri\Uri::__construct |
||
257 | * @covers \OAuth\Common\Http\Uri\Uri::getAuthority |
||
258 | * @covers \OAuth\Common\Http\Uri\Uri::parseUri |
||
259 | */ |
||
260 | public function testGetAuthorityWithoutUserInfoWithExplicitPort(): void |
||
266 | |||
267 | /** |
||
268 | * @covers \OAuth\Common\Http\Uri\Uri::__construct |
||
269 | * @covers \OAuth\Common\Http\Uri\Uri::getAuthority |
||
270 | * @covers \OAuth\Common\Http\Uri\Uri::parseUri |
||
271 | * @covers \OAuth\Common\Http\Uri\Uri::protectUserInfo |
||
272 | * @covers \OAuth\Common\Http\Uri\Uri::setUserInfo |
||
273 | */ |
||
274 | public function testGetAuthorityWithUsernameWithExplicitPort(): void |
||
280 | |||
281 | /** |
||
282 | * @covers \OAuth\Common\Http\Uri\Uri::__construct |
||
283 | * @covers \OAuth\Common\Http\Uri\Uri::getAuthority |
||
284 | * @covers \OAuth\Common\Http\Uri\Uri::parseUri |
||
285 | * @covers \OAuth\Common\Http\Uri\Uri::protectUserInfo |
||
286 | * @covers \OAuth\Common\Http\Uri\Uri::setUserInfo |
||
287 | */ |
||
288 | public function testGetAuthorityWithUsernameAndPassWithExplicitPort(): void |
||
294 | |||
295 | /** |
||
296 | * @covers \OAuth\Common\Http\Uri\Uri::__construct |
||
297 | * @covers \OAuth\Common\Http\Uri\Uri::getAuthority |
||
298 | * @covers \OAuth\Common\Http\Uri\Uri::parseUri |
||
299 | * @covers \OAuth\Common\Http\Uri\Uri::protectUserInfo |
||
300 | * @covers \OAuth\Common\Http\Uri\Uri::setUserInfo |
||
301 | */ |
||
302 | public function testGetAuthorityWithUsernameAndPassWithoutExplicitPort(): void |
||
308 | |||
309 | /** |
||
310 | * @covers \OAuth\Common\Http\Uri\Uri::__construct |
||
311 | * @covers \OAuth\Common\Http\Uri\Uri::getRawAuthority |
||
312 | * @covers \OAuth\Common\Http\Uri\Uri::parseUri |
||
313 | */ |
||
314 | public function testGetRawAuthorityWithoutUserInfo(): void |
||
320 | |||
321 | /** |
||
322 | * @covers \OAuth\Common\Http\Uri\Uri::__construct |
||
323 | * @covers \OAuth\Common\Http\Uri\Uri::getRawAuthority |
||
324 | * @covers \OAuth\Common\Http\Uri\Uri::parseUri |
||
325 | */ |
||
326 | public function testGetRawAuthorityWithoutUserInfoWithExplicitPort(): void |
||
332 | |||
333 | /** |
||
334 | * @covers \OAuth\Common\Http\Uri\Uri::__construct |
||
335 | * @covers \OAuth\Common\Http\Uri\Uri::getRawAuthority |
||
336 | * @covers \OAuth\Common\Http\Uri\Uri::parseUri |
||
337 | * @covers \OAuth\Common\Http\Uri\Uri::protectUserInfo |
||
338 | * @covers \OAuth\Common\Http\Uri\Uri::setUserInfo |
||
339 | */ |
||
340 | public function testGetRawAuthorityWithUsernameWithExplicitPort(): void |
||
346 | |||
347 | /** |
||
348 | * @covers \OAuth\Common\Http\Uri\Uri::__construct |
||
349 | * @covers \OAuth\Common\Http\Uri\Uri::getRawAuthority |
||
350 | * @covers \OAuth\Common\Http\Uri\Uri::parseUri |
||
351 | * @covers \OAuth\Common\Http\Uri\Uri::protectUserInfo |
||
352 | * @covers \OAuth\Common\Http\Uri\Uri::setUserInfo |
||
353 | */ |
||
354 | public function testGetRawAuthorityWithUsernameAndPassWithExplicitPort(): void |
||
360 | |||
361 | /** |
||
362 | * @covers \OAuth\Common\Http\Uri\Uri::__construct |
||
363 | * @covers \OAuth\Common\Http\Uri\Uri::getRawAuthority |
||
364 | * @covers \OAuth\Common\Http\Uri\Uri::parseUri |
||
365 | * @covers \OAuth\Common\Http\Uri\Uri::protectUserInfo |
||
366 | * @covers \OAuth\Common\Http\Uri\Uri::setUserInfo |
||
367 | */ |
||
368 | public function testGetRawAuthorityWithUsernameAndPassWithoutExplicitPort(): void |
||
374 | |||
375 | /** |
||
376 | * @covers \OAuth\Common\Http\Uri\Uri::__construct |
||
377 | * @covers \OAuth\Common\Http\Uri\Uri::getAbsoluteUri |
||
378 | * @covers \OAuth\Common\Http\Uri\Uri::parseUri |
||
379 | */ |
||
380 | public function testGetAbsoluteUriBare(): void |
||
386 | |||
387 | /** |
||
388 | * @covers \OAuth\Common\Http\Uri\Uri::__construct |
||
389 | * @covers \OAuth\Common\Http\Uri\Uri::getAbsoluteUri |
||
390 | * @covers \OAuth\Common\Http\Uri\Uri::getRawAuthority |
||
391 | * @covers \OAuth\Common\Http\Uri\Uri::parseUri |
||
392 | * @covers \OAuth\Common\Http\Uri\Uri::protectUserInfo |
||
393 | * @covers \OAuth\Common\Http\Uri\Uri::setUserInfo |
||
394 | */ |
||
395 | public function testGetAbsoluteUriWithAuthority(): void |
||
401 | |||
402 | /** |
||
403 | * @covers \OAuth\Common\Http\Uri\Uri::__construct |
||
404 | * @covers \OAuth\Common\Http\Uri\Uri::getAbsoluteUri |
||
405 | * @covers \OAuth\Common\Http\Uri\Uri::parseUri |
||
406 | */ |
||
407 | public function testGetAbsoluteUriWithPath(): void |
||
413 | |||
414 | /** |
||
415 | * @covers \OAuth\Common\Http\Uri\Uri::__construct |
||
416 | * @covers \OAuth\Common\Http\Uri\Uri::getAbsoluteUri |
||
417 | * @covers \OAuth\Common\Http\Uri\Uri::parseUri |
||
418 | */ |
||
419 | public function testGetAbsoluteUriWithoutPath(): void |
||
425 | |||
426 | /** |
||
427 | * @covers \OAuth\Common\Http\Uri\Uri::__construct |
||
428 | * @covers \OAuth\Common\Http\Uri\Uri::getAbsoluteUri |
||
429 | * @covers \OAuth\Common\Http\Uri\Uri::parseUri |
||
430 | */ |
||
431 | public function testGetAbsoluteUriWithoutPathExplicitTrailingSlash(): void |
||
437 | |||
438 | /** |
||
439 | * @covers \OAuth\Common\Http\Uri\Uri::__construct |
||
440 | * @covers \OAuth\Common\Http\Uri\Uri::getAbsoluteUri |
||
441 | * @covers \OAuth\Common\Http\Uri\Uri::parseUri |
||
442 | */ |
||
443 | public function testGetAbsoluteUriWithQuery(): void |
||
449 | |||
450 | /** |
||
451 | * @covers \OAuth\Common\Http\Uri\Uri::__construct |
||
452 | * @covers \OAuth\Common\Http\Uri\Uri::getAbsoluteUri |
||
453 | * @covers \OAuth\Common\Http\Uri\Uri::parseUri |
||
454 | */ |
||
455 | public function testGetAbsoluteUriWithFragment(): void |
||
461 | |||
462 | /** |
||
463 | * @covers \OAuth\Common\Http\Uri\Uri::__construct |
||
464 | * @covers \OAuth\Common\Http\Uri\Uri::getRelativeUri |
||
465 | * @covers \OAuth\Common\Http\Uri\Uri::parseUri |
||
466 | */ |
||
467 | public function testGetRelativeUriWithoutPath(): void |
||
473 | |||
474 | /** |
||
475 | * @covers \OAuth\Common\Http\Uri\Uri::__construct |
||
476 | * @covers \OAuth\Common\Http\Uri\Uri::getRelativeUri |
||
477 | * @covers \OAuth\Common\Http\Uri\Uri::parseUri |
||
478 | */ |
||
479 | public function testGetRelativeUriWithPath(): void |
||
485 | |||
486 | /** |
||
487 | * @covers \OAuth\Common\Http\Uri\Uri::__construct |
||
488 | * @covers \OAuth\Common\Http\Uri\Uri::getRelativeUri |
||
489 | * @covers \OAuth\Common\Http\Uri\Uri::parseUri |
||
490 | */ |
||
491 | public function testGetRelativeUriWithExplicitTrailingSlash(): void |
||
497 | |||
498 | /** |
||
499 | * @covers \OAuth\Common\Http\Uri\Uri::__construct |
||
500 | * @covers \OAuth\Common\Http\Uri\Uri::__toString |
||
501 | * @covers \OAuth\Common\Http\Uri\Uri::parseUri |
||
502 | */ |
||
503 | public function testToStringBare(): void |
||
509 | |||
510 | /** |
||
511 | * @covers \OAuth\Common\Http\Uri\Uri::__construct |
||
512 | * @covers \OAuth\Common\Http\Uri\Uri::__toString |
||
513 | * @covers \OAuth\Common\Http\Uri\Uri::getRawAuthority |
||
514 | * @covers \OAuth\Common\Http\Uri\Uri::parseUri |
||
515 | * @covers \OAuth\Common\Http\Uri\Uri::protectUserInfo |
||
516 | * @covers \OAuth\Common\Http\Uri\Uri::setUserInfo |
||
517 | */ |
||
518 | public function testToStringWithAuthority(): void |
||
524 | |||
525 | /** |
||
526 | * @covers \OAuth\Common\Http\Uri\Uri::__construct |
||
527 | * @covers \OAuth\Common\Http\Uri\Uri::__toString |
||
528 | * @covers \OAuth\Common\Http\Uri\Uri::parseUri |
||
529 | */ |
||
530 | public function testToStringWithPath(): void |
||
536 | |||
537 | /** |
||
538 | * @covers \OAuth\Common\Http\Uri\Uri::__construct |
||
539 | * @covers \OAuth\Common\Http\Uri\Uri::__toString |
||
540 | * @covers \OAuth\Common\Http\Uri\Uri::parseUri |
||
541 | */ |
||
542 | public function testToStringWithoutPath(): void |
||
548 | |||
549 | /** |
||
550 | * @covers \OAuth\Common\Http\Uri\Uri::__construct |
||
551 | * @covers \OAuth\Common\Http\Uri\Uri::__toString |
||
552 | * @covers \OAuth\Common\Http\Uri\Uri::parseUri |
||
553 | */ |
||
554 | public function testToStringWithoutPathExplicitTrailingSlash(): void |
||
560 | |||
561 | /** |
||
562 | * @covers \OAuth\Common\Http\Uri\Uri::__construct |
||
563 | * @covers \OAuth\Common\Http\Uri\Uri::__toString |
||
564 | * @covers \OAuth\Common\Http\Uri\Uri::parseUri |
||
565 | */ |
||
566 | public function testToStringWithQuery(): void |
||
572 | |||
573 | /** |
||
574 | * @covers \OAuth\Common\Http\Uri\Uri::__construct |
||
575 | * @covers \OAuth\Common\Http\Uri\Uri::__toString |
||
576 | * @covers \OAuth\Common\Http\Uri\Uri::parseUri |
||
577 | */ |
||
578 | public function testToStringWithFragment(): void |
||
584 | |||
585 | /** |
||
586 | * @covers \OAuth\Common\Http\Uri\Uri::__construct |
||
587 | * @covers \OAuth\Common\Http\Uri\Uri::getAbsoluteUri |
||
588 | * @covers \OAuth\Common\Http\Uri\Uri::parseUri |
||
589 | * @covers \OAuth\Common\Http\Uri\Uri::setPath |
||
590 | */ |
||
591 | public function testSetPathEmpty(): void |
||
598 | |||
599 | /** |
||
600 | * @covers \OAuth\Common\Http\Uri\Uri::__construct |
||
601 | * @covers \OAuth\Common\Http\Uri\Uri::getAbsoluteUri |
||
602 | * @covers \OAuth\Common\Http\Uri\Uri::parseUri |
||
603 | * @covers \OAuth\Common\Http\Uri\Uri::setPath |
||
604 | */ |
||
605 | public function testSetPathWithPath(): void |
||
612 | |||
613 | /** |
||
614 | * @covers \OAuth\Common\Http\Uri\Uri::__construct |
||
615 | * @covers \OAuth\Common\Http\Uri\Uri::getAbsoluteUri |
||
616 | * @covers \OAuth\Common\Http\Uri\Uri::parseUri |
||
617 | * @covers \OAuth\Common\Http\Uri\Uri::setPath |
||
618 | */ |
||
619 | public function testSetPathWithOnlySlash(): void |
||
626 | |||
627 | /** |
||
628 | * @covers \OAuth\Common\Http\Uri\Uri::__construct |
||
629 | * @covers \OAuth\Common\Http\Uri\Uri::getAbsoluteUri |
||
630 | * @covers \OAuth\Common\Http\Uri\Uri::parseUri |
||
631 | * @covers \OAuth\Common\Http\Uri\Uri::setQuery |
||
632 | */ |
||
633 | public function testSetQueryEmpty(): void |
||
640 | |||
641 | /** |
||
642 | * @covers \OAuth\Common\Http\Uri\Uri::__construct |
||
643 | * @covers \OAuth\Common\Http\Uri\Uri::getAbsoluteUri |
||
644 | * @covers \OAuth\Common\Http\Uri\Uri::parseUri |
||
645 | * @covers \OAuth\Common\Http\Uri\Uri::setQuery |
||
646 | */ |
||
647 | public function testSetQueryFilled(): void |
||
654 | |||
655 | /** |
||
656 | * @covers \OAuth\Common\Http\Uri\Uri::__construct |
||
657 | * @covers \OAuth\Common\Http\Uri\Uri::addToQuery |
||
658 | * @covers \OAuth\Common\Http\Uri\Uri::getAbsoluteUri |
||
659 | * @covers \OAuth\Common\Http\Uri\Uri::parseUri |
||
660 | */ |
||
661 | public function testAddToQueryAppend(): void |
||
668 | |||
669 | /** |
||
670 | * @covers \OAuth\Common\Http\Uri\Uri::__construct |
||
671 | * @covers \OAuth\Common\Http\Uri\Uri::addToQuery |
||
672 | * @covers \OAuth\Common\Http\Uri\Uri::getAbsoluteUri |
||
673 | * @covers \OAuth\Common\Http\Uri\Uri::parseUri |
||
674 | */ |
||
675 | public function testAddToQueryCreate(): void |
||
682 | |||
683 | /** |
||
684 | * @covers \OAuth\Common\Http\Uri\Uri::__construct |
||
685 | * @covers \OAuth\Common\Http\Uri\Uri::getAbsoluteUri |
||
686 | * @covers \OAuth\Common\Http\Uri\Uri::parseUri |
||
687 | * @covers \OAuth\Common\Http\Uri\Uri::setFragment |
||
688 | */ |
||
689 | public function testSetFragmentEmpty(): void |
||
696 | |||
697 | /** |
||
698 | * @covers \OAuth\Common\Http\Uri\Uri::__construct |
||
699 | * @covers \OAuth\Common\Http\Uri\Uri::getAbsoluteUri |
||
700 | * @covers \OAuth\Common\Http\Uri\Uri::parseUri |
||
701 | * @covers \OAuth\Common\Http\Uri\Uri::setFragment |
||
702 | */ |
||
703 | public function testSetFragmentWithData(): void |
||
710 | |||
711 | /** |
||
712 | * @covers \OAuth\Common\Http\Uri\Uri::__construct |
||
713 | * @covers \OAuth\Common\Http\Uri\Uri::getAbsoluteUri |
||
714 | * @covers \OAuth\Common\Http\Uri\Uri::parseUri |
||
715 | * @covers \OAuth\Common\Http\Uri\Uri::setScheme |
||
716 | */ |
||
717 | public function testSetSchemeWithEmpty(): void |
||
724 | |||
725 | /** |
||
726 | * @covers \OAuth\Common\Http\Uri\Uri::__construct |
||
727 | * @covers \OAuth\Common\Http\Uri\Uri::getAbsoluteUri |
||
728 | * @covers \OAuth\Common\Http\Uri\Uri::parseUri |
||
729 | * @covers \OAuth\Common\Http\Uri\Uri::setScheme |
||
730 | */ |
||
731 | public function testSetSchemeWithData(): void |
||
738 | |||
739 | /** |
||
740 | * @covers \OAuth\Common\Http\Uri\Uri::__construct |
||
741 | * @covers \OAuth\Common\Http\Uri\Uri::getAbsoluteUri |
||
742 | * @covers \OAuth\Common\Http\Uri\Uri::parseUri |
||
743 | * @covers \OAuth\Common\Http\Uri\Uri::setUserInfo |
||
744 | */ |
||
745 | public function testSetUserInfoEmpty(): void |
||
752 | |||
753 | /** |
||
754 | * @covers \OAuth\Common\Http\Uri\Uri::__construct |
||
755 | * @covers \OAuth\Common\Http\Uri\Uri::getAbsoluteUri |
||
756 | * @covers \OAuth\Common\Http\Uri\Uri::parseUri |
||
757 | * @covers \OAuth\Common\Http\Uri\Uri::protectUserInfo |
||
758 | * @covers \OAuth\Common\Http\Uri\Uri::setUserInfo |
||
759 | */ |
||
760 | public function testSetUserInfoWithData(): void |
||
767 | |||
768 | /** |
||
769 | * @covers \OAuth\Common\Http\Uri\Uri::__construct |
||
770 | * @covers \OAuth\Common\Http\Uri\Uri::getAbsoluteUri |
||
771 | * @covers \OAuth\Common\Http\Uri\Uri::parseUri |
||
772 | * @covers \OAuth\Common\Http\Uri\Uri::setPort |
||
773 | */ |
||
774 | public function testSetPortCustom(): void |
||
781 | |||
782 | /** |
||
783 | * @covers \OAuth\Common\Http\Uri\Uri::__construct |
||
784 | * @covers \OAuth\Common\Http\Uri\Uri::getAbsoluteUri |
||
785 | * @covers \OAuth\Common\Http\Uri\Uri::parseUri |
||
786 | * @covers \OAuth\Common\Http\Uri\Uri::setPort |
||
787 | */ |
||
788 | public function testSetPortHttpImplicit(): void |
||
795 | |||
796 | /** |
||
797 | * @covers \OAuth\Common\Http\Uri\Uri::__construct |
||
798 | * @covers \OAuth\Common\Http\Uri\Uri::getAbsoluteUri |
||
799 | * @covers \OAuth\Common\Http\Uri\Uri::parseUri |
||
800 | * @covers \OAuth\Common\Http\Uri\Uri::setPort |
||
801 | */ |
||
802 | public function testSetPortHttpsImplicit(): void |
||
809 | |||
810 | /** |
||
811 | * @covers \OAuth\Common\Http\Uri\Uri::__construct |
||
812 | * @covers \OAuth\Common\Http\Uri\Uri::getAbsoluteUri |
||
813 | * @covers \OAuth\Common\Http\Uri\Uri::parseUri |
||
814 | * @covers \OAuth\Common\Http\Uri\Uri::setPort |
||
815 | */ |
||
816 | public function testSetPortHttpExplicit(): void |
||
823 | |||
824 | /** |
||
825 | * @covers \OAuth\Common\Http\Uri\Uri::__construct |
||
826 | * @covers \OAuth\Common\Http\Uri\Uri::getAbsoluteUri |
||
827 | * @covers \OAuth\Common\Http\Uri\Uri::parseUri |
||
828 | * @covers \OAuth\Common\Http\Uri\Uri::setPort |
||
829 | */ |
||
830 | public function testSetPortHttpsExplicit(): void |
||
837 | |||
838 | /** |
||
839 | * @covers \OAuth\Common\Http\Uri\Uri::__construct |
||
840 | * @covers \OAuth\Common\Http\Uri\Uri::getAbsoluteUri |
||
841 | * @covers \OAuth\Common\Http\Uri\Uri::parseUri |
||
842 | * @covers \OAuth\Common\Http\Uri\Uri::setHost |
||
843 | */ |
||
844 | public function testSetHost(): void |
||
851 | |||
852 | /** |
||
853 | * @covers \OAuth\Common\Http\Uri\Uri::__construct |
||
854 | * @covers \OAuth\Common\Http\Uri\Uri::hasExplicitTrailingHostSlash |
||
855 | * @covers \OAuth\Common\Http\Uri\Uri::parseUri |
||
856 | */ |
||
857 | public function testHasExplicitTrailingHostSlashTrue(): void |
||
863 | |||
864 | /** |
||
865 | * @covers \OAuth\Common\Http\Uri\Uri::__construct |
||
866 | * @covers \OAuth\Common\Http\Uri\Uri::hasExplicitTrailingHostSlash |
||
867 | * @covers \OAuth\Common\Http\Uri\Uri::parseUri |
||
868 | */ |
||
869 | public function testHasExplicitTrailingHostSlashFalse(): void |
||
875 | |||
876 | /** |
||
877 | * @covers \OAuth\Common\Http\Uri\Uri::__construct |
||
878 | * @covers \OAuth\Common\Http\Uri\Uri::hasExplicitPortSpecified |
||
879 | * @covers \OAuth\Common\Http\Uri\Uri::parseUri |
||
880 | */ |
||
881 | public function testHasExplicitPortSpecifiedTrue(): void |
||
887 | |||
888 | /** |
||
889 | * @covers \OAuth\Common\Http\Uri\Uri::__construct |
||
890 | * @covers \OAuth\Common\Http\Uri\Uri::hasExplicitPortSpecified |
||
891 | * @covers \OAuth\Common\Http\Uri\Uri::parseUri |
||
892 | */ |
||
893 | public function testHasExplicitPortSpecifiedFalse(): void |
||
899 | } |
||
900 |
This check looks for variable assignements that are either overwritten by other assignments or where the variable is not used subsequently.
Both the
$myVar
assignment in line 1 and the$higher
assignment in line 2 are dead. The first because$myVar
is never used and the second because$higher
is always overwritten for every possible time line.