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 |
||
7 | class UriTest extends \PHPUnit_Framework_TestCase |
||
8 | { |
||
9 | /** |
||
10 | * @covers OAuth\Common\Http\Uri\Uri::__construct |
||
11 | */ |
||
12 | public function testConstructCorrectInterfaceWithoutUri() |
||
18 | |||
19 | /** |
||
20 | * @covers OAuth\Common\Http\Uri\Uri::__construct |
||
21 | * @covers OAuth\Common\Http\Uri\Uri::parseUri |
||
22 | */ |
||
23 | public function testConstructThrowsExceptionOnInvalidUri() |
||
30 | |||
31 | /** |
||
32 | * @covers OAuth\Common\Http\Uri\Uri::__construct |
||
33 | * @covers OAuth\Common\Http\Uri\Uri::parseUri |
||
34 | */ |
||
35 | public function testConstructThrowsExceptionOnUriWithoutScheme() |
||
41 | |||
42 | /** |
||
43 | * @covers OAuth\Common\Http\Uri\Uri::__construct |
||
44 | * @covers OAuth\Common\Http\Uri\Uri::parseUri |
||
45 | * @covers OAuth\Common\Http\Uri\Uri::getScheme |
||
46 | */ |
||
47 | public function testGetScheme() |
||
53 | |||
54 | /** |
||
55 | * @covers OAuth\Common\Http\Uri\Uri::__construct |
||
56 | * @covers OAuth\Common\Http\Uri\Uri::parseUri |
||
57 | * @covers OAuth\Common\Http\Uri\Uri::setUserInfo |
||
58 | * @covers OAuth\Common\Http\Uri\Uri::protectUserInfo |
||
59 | * @covers OAuth\Common\Http\Uri\Uri::getUserInfo |
||
60 | */ |
||
61 | public function testGetUserInfo() |
||
67 | |||
68 | /** |
||
69 | * @covers OAuth\Common\Http\Uri\Uri::__construct |
||
70 | * @covers OAuth\Common\Http\Uri\Uri::parseUri |
||
71 | * @covers OAuth\Common\Http\Uri\Uri::setUserInfo |
||
72 | * @covers OAuth\Common\Http\Uri\Uri::protectUserInfo |
||
73 | * @covers OAuth\Common\Http\Uri\Uri::getUserInfo |
||
74 | */ |
||
75 | public function testGetUserInfoWithPass() |
||
81 | |||
82 | /** |
||
83 | * @covers OAuth\Common\Http\Uri\Uri::__construct |
||
84 | * @covers OAuth\Common\Http\Uri\Uri::parseUri |
||
85 | * @covers OAuth\Common\Http\Uri\Uri::setUserInfo |
||
86 | * @covers OAuth\Common\Http\Uri\Uri::protectUserInfo |
||
87 | * @covers OAuth\Common\Http\Uri\Uri::getRawUserInfo |
||
88 | */ |
||
89 | public function testGetRawUserInfo() |
||
95 | |||
96 | /** |
||
97 | * @covers OAuth\Common\Http\Uri\Uri::__construct |
||
98 | * @covers OAuth\Common\Http\Uri\Uri::parseUri |
||
99 | * @covers OAuth\Common\Http\Uri\Uri::setUserInfo |
||
100 | * @covers OAuth\Common\Http\Uri\Uri::protectUserInfo |
||
101 | * @covers OAuth\Common\Http\Uri\Uri::getRawUserInfo |
||
102 | */ |
||
103 | public function testGetRawUserInfoWithPass() |
||
109 | |||
110 | /** |
||
111 | * @covers OAuth\Common\Http\Uri\Uri::__construct |
||
112 | * @covers OAuth\Common\Http\Uri\Uri::parseUri |
||
113 | * @covers OAuth\Common\Http\Uri\Uri::getHost |
||
114 | */ |
||
115 | public function testGetHost() |
||
121 | |||
122 | /** |
||
123 | * @covers OAuth\Common\Http\Uri\Uri::__construct |
||
124 | * @covers OAuth\Common\Http\Uri\Uri::parseUri |
||
125 | * @covers OAuth\Common\Http\Uri\Uri::getPort |
||
126 | */ |
||
127 | public function testGetPortImplicitHttp() |
||
133 | |||
134 | /** |
||
135 | * @covers OAuth\Common\Http\Uri\Uri::__construct |
||
136 | * @covers OAuth\Common\Http\Uri\Uri::parseUri |
||
137 | * @covers OAuth\Common\Http\Uri\Uri::getPort |
||
138 | */ |
||
139 | public function testGetPortImplicitHttps() |
||
145 | |||
146 | /** |
||
147 | * @covers OAuth\Common\Http\Uri\Uri::__construct |
||
148 | * @covers OAuth\Common\Http\Uri\Uri::parseUri |
||
149 | * @covers OAuth\Common\Http\Uri\Uri::getPort |
||
150 | */ |
||
151 | public function testGetPortExplicit() |
||
157 | |||
158 | /** |
||
159 | * @covers OAuth\Common\Http\Uri\Uri::__construct |
||
160 | * @covers OAuth\Common\Http\Uri\Uri::parseUri |
||
161 | * @covers OAuth\Common\Http\Uri\Uri::getPath |
||
162 | */ |
||
163 | public function testGetPathNotSupplied() |
||
169 | |||
170 | /** |
||
171 | * @covers OAuth\Common\Http\Uri\Uri::__construct |
||
172 | * @covers OAuth\Common\Http\Uri\Uri::parseUri |
||
173 | * @covers OAuth\Common\Http\Uri\Uri::getPath |
||
174 | */ |
||
175 | public function testGetPathSlash() |
||
181 | |||
182 | /** |
||
183 | * @covers OAuth\Common\Http\Uri\Uri::__construct |
||
184 | * @covers OAuth\Common\Http\Uri\Uri::parseUri |
||
185 | * @covers OAuth\Common\Http\Uri\Uri::getPath |
||
186 | */ |
||
187 | public function testGetPath() |
||
193 | |||
194 | /** |
||
195 | * @covers OAuth\Common\Http\Uri\Uri::__construct |
||
196 | * @covers OAuth\Common\Http\Uri\Uri::parseUri |
||
197 | * @covers OAuth\Common\Http\Uri\Uri::getQuery |
||
198 | */ |
||
199 | public function testGetQueryWithParams() |
||
205 | |||
206 | /** |
||
207 | * @covers OAuth\Common\Http\Uri\Uri::__construct |
||
208 | * @covers OAuth\Common\Http\Uri\Uri::parseUri |
||
209 | * @covers OAuth\Common\Http\Uri\Uri::getQuery |
||
210 | */ |
||
211 | public function testGetQueryWithoutParams() |
||
217 | |||
218 | /** |
||
219 | * @covers OAuth\Common\Http\Uri\Uri::__construct |
||
220 | * @covers OAuth\Common\Http\Uri\Uri::parseUri |
||
221 | * @covers OAuth\Common\Http\Uri\Uri::getFragment |
||
222 | */ |
||
223 | public function testGetFragmentExists() |
||
229 | |||
230 | /** |
||
231 | * @covers OAuth\Common\Http\Uri\Uri::__construct |
||
232 | * @covers OAuth\Common\Http\Uri\Uri::parseUri |
||
233 | * @covers OAuth\Common\Http\Uri\Uri::getFragment |
||
234 | */ |
||
235 | public function testGetFragmentNotExists() |
||
241 | |||
242 | /** |
||
243 | * @covers OAuth\Common\Http\Uri\Uri::__construct |
||
244 | * @covers OAuth\Common\Http\Uri\Uri::parseUri |
||
245 | * @covers OAuth\Common\Http\Uri\Uri::getAuthority |
||
246 | */ |
||
247 | public function testGetAuthorityWithoutUserInfo() |
||
253 | |||
254 | /** |
||
255 | * @covers OAuth\Common\Http\Uri\Uri::__construct |
||
256 | * @covers OAuth\Common\Http\Uri\Uri::parseUri |
||
257 | * @covers OAuth\Common\Http\Uri\Uri::getAuthority |
||
258 | */ |
||
259 | public function testGetAuthorityWithoutUserInfoWithExplicitPort() |
||
265 | |||
266 | /** |
||
267 | * @covers OAuth\Common\Http\Uri\Uri::__construct |
||
268 | * @covers OAuth\Common\Http\Uri\Uri::parseUri |
||
269 | * @covers OAuth\Common\Http\Uri\Uri::setUserInfo |
||
270 | * @covers OAuth\Common\Http\Uri\Uri::protectUserInfo |
||
271 | * @covers OAuth\Common\Http\Uri\Uri::getAuthority |
||
272 | */ |
||
273 | public function testGetAuthorityWithUsernameWithExplicitPort() |
||
279 | |||
280 | /** |
||
281 | * @covers OAuth\Common\Http\Uri\Uri::__construct |
||
282 | * @covers OAuth\Common\Http\Uri\Uri::parseUri |
||
283 | * @covers OAuth\Common\Http\Uri\Uri::setUserInfo |
||
284 | * @covers OAuth\Common\Http\Uri\Uri::protectUserInfo |
||
285 | * @covers OAuth\Common\Http\Uri\Uri::getAuthority |
||
286 | */ |
||
287 | public function testGetAuthorityWithUsernameAndPassWithExplicitPort() |
||
293 | |||
294 | /** |
||
295 | * @covers OAuth\Common\Http\Uri\Uri::__construct |
||
296 | * @covers OAuth\Common\Http\Uri\Uri::parseUri |
||
297 | * @covers OAuth\Common\Http\Uri\Uri::setUserInfo |
||
298 | * @covers OAuth\Common\Http\Uri\Uri::protectUserInfo |
||
299 | * @covers OAuth\Common\Http\Uri\Uri::getAuthority |
||
300 | */ |
||
301 | public function testGetAuthorityWithUsernameAndPassWithoutExplicitPort() |
||
307 | |||
308 | /** |
||
309 | * @covers OAuth\Common\Http\Uri\Uri::__construct |
||
310 | * @covers OAuth\Common\Http\Uri\Uri::parseUri |
||
311 | * @covers OAuth\Common\Http\Uri\Uri::getRawAuthority |
||
312 | */ |
||
313 | public function testGetRawAuthorityWithoutUserInfo() |
||
319 | |||
320 | /** |
||
321 | * @covers OAuth\Common\Http\Uri\Uri::__construct |
||
322 | * @covers OAuth\Common\Http\Uri\Uri::parseUri |
||
323 | * @covers OAuth\Common\Http\Uri\Uri::getRawAuthority |
||
324 | */ |
||
325 | public function testGetRawAuthorityWithoutUserInfoWithExplicitPort() |
||
331 | |||
332 | /** |
||
333 | * @covers OAuth\Common\Http\Uri\Uri::__construct |
||
334 | * @covers OAuth\Common\Http\Uri\Uri::parseUri |
||
335 | * @covers OAuth\Common\Http\Uri\Uri::setUserInfo |
||
336 | * @covers OAuth\Common\Http\Uri\Uri::protectUserInfo |
||
337 | * @covers OAuth\Common\Http\Uri\Uri::getRawAuthority |
||
338 | */ |
||
339 | public function testGetRawAuthorityWithUsernameWithExplicitPort() |
||
345 | |||
346 | /** |
||
347 | * @covers OAuth\Common\Http\Uri\Uri::__construct |
||
348 | * @covers OAuth\Common\Http\Uri\Uri::parseUri |
||
349 | * @covers OAuth\Common\Http\Uri\Uri::setUserInfo |
||
350 | * @covers OAuth\Common\Http\Uri\Uri::protectUserInfo |
||
351 | * @covers OAuth\Common\Http\Uri\Uri::getRawAuthority |
||
352 | */ |
||
353 | public function testGetRawAuthorityWithUsernameAndPassWithExplicitPort() |
||
359 | |||
360 | /** |
||
361 | * @covers OAuth\Common\Http\Uri\Uri::__construct |
||
362 | * @covers OAuth\Common\Http\Uri\Uri::parseUri |
||
363 | * @covers OAuth\Common\Http\Uri\Uri::setUserInfo |
||
364 | * @covers OAuth\Common\Http\Uri\Uri::protectUserInfo |
||
365 | * @covers OAuth\Common\Http\Uri\Uri::getRawAuthority |
||
366 | */ |
||
367 | public function testGetRawAuthorityWithUsernameAndPassWithoutExplicitPort() |
||
373 | |||
374 | /** |
||
375 | * @covers OAuth\Common\Http\Uri\Uri::__construct |
||
376 | * @covers OAuth\Common\Http\Uri\Uri::parseUri |
||
377 | * @covers OAuth\Common\Http\Uri\Uri::getAbsoluteUri |
||
378 | */ |
||
379 | public function testGetAbsoluteUriBare() |
||
385 | |||
386 | /** |
||
387 | * @covers OAuth\Common\Http\Uri\Uri::__construct |
||
388 | * @covers OAuth\Common\Http\Uri\Uri::parseUri |
||
389 | * @covers OAuth\Common\Http\Uri\Uri::setUserInfo |
||
390 | * @covers OAuth\Common\Http\Uri\Uri::protectUserInfo |
||
391 | * @covers OAuth\Common\Http\Uri\Uri::getRawAuthority |
||
392 | * @covers OAuth\Common\Http\Uri\Uri::getAbsoluteUri |
||
393 | */ |
||
394 | public function testGetAbsoluteUriWithAuthority() |
||
400 | |||
401 | /** |
||
402 | * @covers OAuth\Common\Http\Uri\Uri::__construct |
||
403 | * @covers OAuth\Common\Http\Uri\Uri::parseUri |
||
404 | * @covers OAuth\Common\Http\Uri\Uri::getAbsoluteUri |
||
405 | */ |
||
406 | public function testGetAbsoluteUriWithPath() |
||
412 | |||
413 | /** |
||
414 | * @covers OAuth\Common\Http\Uri\Uri::__construct |
||
415 | * @covers OAuth\Common\Http\Uri\Uri::parseUri |
||
416 | * @covers OAuth\Common\Http\Uri\Uri::getAbsoluteUri |
||
417 | */ |
||
418 | public function testGetAbsoluteUriWithoutPath() |
||
424 | |||
425 | /** |
||
426 | * @covers OAuth\Common\Http\Uri\Uri::__construct |
||
427 | * @covers OAuth\Common\Http\Uri\Uri::parseUri |
||
428 | * @covers OAuth\Common\Http\Uri\Uri::getAbsoluteUri |
||
429 | */ |
||
430 | public function testGetAbsoluteUriWithoutPathExplicitTrailingSlash() |
||
436 | |||
437 | /** |
||
438 | * @covers OAuth\Common\Http\Uri\Uri::__construct |
||
439 | * @covers OAuth\Common\Http\Uri\Uri::parseUri |
||
440 | * @covers OAuth\Common\Http\Uri\Uri::getAbsoluteUri |
||
441 | */ |
||
442 | public function testGetAbsoluteUriWithQuery() |
||
448 | |||
449 | /** |
||
450 | * @covers OAuth\Common\Http\Uri\Uri::__construct |
||
451 | * @covers OAuth\Common\Http\Uri\Uri::parseUri |
||
452 | * @covers OAuth\Common\Http\Uri\Uri::getAbsoluteUri |
||
453 | */ |
||
454 | public function testGetAbsoluteUriWithFragment() |
||
460 | |||
461 | /** |
||
462 | * @covers OAuth\Common\Http\Uri\Uri::__construct |
||
463 | * @covers OAuth\Common\Http\Uri\Uri::parseUri |
||
464 | * @covers OAuth\Common\Http\Uri\Uri::getRelativeUri |
||
465 | */ |
||
466 | public function testGetRelativeUriWithoutPath() |
||
472 | |||
473 | /** |
||
474 | * @covers OAuth\Common\Http\Uri\Uri::__construct |
||
475 | * @covers OAuth\Common\Http\Uri\Uri::parseUri |
||
476 | * @covers OAuth\Common\Http\Uri\Uri::getRelativeUri |
||
477 | */ |
||
478 | public function testGetRelativeUriWithPath() |
||
484 | |||
485 | /** |
||
486 | * @covers OAuth\Common\Http\Uri\Uri::__construct |
||
487 | * @covers OAuth\Common\Http\Uri\Uri::parseUri |
||
488 | * @covers OAuth\Common\Http\Uri\Uri::getRelativeUri |
||
489 | */ |
||
490 | public function testGetRelativeUriWithExplicitTrailingSlash() |
||
496 | |||
497 | /** |
||
498 | * @covers OAuth\Common\Http\Uri\Uri::__construct |
||
499 | * @covers OAuth\Common\Http\Uri\Uri::parseUri |
||
500 | * @covers OAuth\Common\Http\Uri\Uri::__toString |
||
501 | */ |
||
502 | public function testToStringBare() |
||
508 | |||
509 | /** |
||
510 | * @covers OAuth\Common\Http\Uri\Uri::__construct |
||
511 | * @covers OAuth\Common\Http\Uri\Uri::parseUri |
||
512 | * @covers OAuth\Common\Http\Uri\Uri::setUserInfo |
||
513 | * @covers OAuth\Common\Http\Uri\Uri::protectUserInfo |
||
514 | * @covers OAuth\Common\Http\Uri\Uri::getRawAuthority |
||
515 | * @covers OAuth\Common\Http\Uri\Uri::__toString |
||
516 | */ |
||
517 | public function testToStringWithAuthority() |
||
523 | |||
524 | /** |
||
525 | * @covers OAuth\Common\Http\Uri\Uri::__construct |
||
526 | * @covers OAuth\Common\Http\Uri\Uri::parseUri |
||
527 | * @covers OAuth\Common\Http\Uri\Uri::__toString |
||
528 | */ |
||
529 | public function testToStringWithPath() |
||
535 | |||
536 | /** |
||
537 | * @covers OAuth\Common\Http\Uri\Uri::__construct |
||
538 | * @covers OAuth\Common\Http\Uri\Uri::parseUri |
||
539 | * @covers OAuth\Common\Http\Uri\Uri::__toString |
||
540 | */ |
||
541 | public function testToStringWithoutPath() |
||
547 | |||
548 | /** |
||
549 | * @covers OAuth\Common\Http\Uri\Uri::__construct |
||
550 | * @covers OAuth\Common\Http\Uri\Uri::parseUri |
||
551 | * @covers OAuth\Common\Http\Uri\Uri::__toString |
||
552 | */ |
||
553 | public function testToStringWithoutPathExplicitTrailingSlash() |
||
559 | |||
560 | /** |
||
561 | * @covers OAuth\Common\Http\Uri\Uri::__construct |
||
562 | * @covers OAuth\Common\Http\Uri\Uri::parseUri |
||
563 | * @covers OAuth\Common\Http\Uri\Uri::__toString |
||
564 | */ |
||
565 | public function testToStringWithQuery() |
||
571 | |||
572 | /** |
||
573 | * @covers OAuth\Common\Http\Uri\Uri::__construct |
||
574 | * @covers OAuth\Common\Http\Uri\Uri::parseUri |
||
575 | * @covers OAuth\Common\Http\Uri\Uri::__toString |
||
576 | */ |
||
577 | public function testToStringWithFragment() |
||
583 | |||
584 | /** |
||
585 | * @covers OAuth\Common\Http\Uri\Uri::__construct |
||
586 | * @covers OAuth\Common\Http\Uri\Uri::parseUri |
||
587 | * @covers OAuth\Common\Http\Uri\Uri::setPath |
||
588 | * @covers OAuth\Common\Http\Uri\Uri::getAbsoluteUri |
||
589 | */ |
||
590 | public function testSetPathEmpty() |
||
597 | |||
598 | /** |
||
599 | * @covers OAuth\Common\Http\Uri\Uri::__construct |
||
600 | * @covers OAuth\Common\Http\Uri\Uri::parseUri |
||
601 | * @covers OAuth\Common\Http\Uri\Uri::setPath |
||
602 | * @covers OAuth\Common\Http\Uri\Uri::getAbsoluteUri |
||
603 | */ |
||
604 | public function testSetPathWithPath() |
||
611 | |||
612 | /** |
||
613 | * @covers OAuth\Common\Http\Uri\Uri::__construct |
||
614 | * @covers OAuth\Common\Http\Uri\Uri::parseUri |
||
615 | * @covers OAuth\Common\Http\Uri\Uri::setPath |
||
616 | * @covers OAuth\Common\Http\Uri\Uri::getAbsoluteUri |
||
617 | */ |
||
618 | public function testSetPathWithOnlySlash() |
||
625 | |||
626 | /** |
||
627 | * @covers OAuth\Common\Http\Uri\Uri::__construct |
||
628 | * @covers OAuth\Common\Http\Uri\Uri::parseUri |
||
629 | * @covers OAuth\Common\Http\Uri\Uri::setQuery |
||
630 | * @covers OAuth\Common\Http\Uri\Uri::getAbsoluteUri |
||
631 | */ |
||
632 | public function testSetQueryEmpty() |
||
639 | |||
640 | /** |
||
641 | * @covers OAuth\Common\Http\Uri\Uri::__construct |
||
642 | * @covers OAuth\Common\Http\Uri\Uri::parseUri |
||
643 | * @covers OAuth\Common\Http\Uri\Uri::setQuery |
||
644 | * @covers OAuth\Common\Http\Uri\Uri::getAbsoluteUri |
||
645 | */ |
||
646 | public function testSetQueryFilled() |
||
653 | |||
654 | /** |
||
655 | * @covers OAuth\Common\Http\Uri\Uri::__construct |
||
656 | * @covers OAuth\Common\Http\Uri\Uri::parseUri |
||
657 | * @covers OAuth\Common\Http\Uri\Uri::addToQuery |
||
658 | * @covers OAuth\Common\Http\Uri\Uri::getAbsoluteUri |
||
659 | */ |
||
660 | public function testAddToQueryAppend() |
||
667 | |||
668 | /** |
||
669 | * @covers OAuth\Common\Http\Uri\Uri::__construct |
||
670 | * @covers OAuth\Common\Http\Uri\Uri::parseUri |
||
671 | * @covers OAuth\Common\Http\Uri\Uri::addToQuery |
||
672 | * @covers OAuth\Common\Http\Uri\Uri::getAbsoluteUri |
||
673 | */ |
||
674 | public function testAddToQueryCreate() |
||
681 | |||
682 | /** |
||
683 | * @covers OAuth\Common\Http\Uri\Uri::__construct |
||
684 | * @covers OAuth\Common\Http\Uri\Uri::parseUri |
||
685 | * @covers OAuth\Common\Http\Uri\Uri::setFragment |
||
686 | * @covers OAuth\Common\Http\Uri\Uri::getAbsoluteUri |
||
687 | */ |
||
688 | public function testSetFragmentEmpty() |
||
695 | |||
696 | /** |
||
697 | * @covers OAuth\Common\Http\Uri\Uri::__construct |
||
698 | * @covers OAuth\Common\Http\Uri\Uri::parseUri |
||
699 | * @covers OAuth\Common\Http\Uri\Uri::setFragment |
||
700 | * @covers OAuth\Common\Http\Uri\Uri::getAbsoluteUri |
||
701 | */ |
||
702 | public function testSetFragmentWithData() |
||
709 | |||
710 | /** |
||
711 | * @covers OAuth\Common\Http\Uri\Uri::__construct |
||
712 | * @covers OAuth\Common\Http\Uri\Uri::parseUri |
||
713 | * @covers OAuth\Common\Http\Uri\Uri::setScheme |
||
714 | * @covers OAuth\Common\Http\Uri\Uri::getAbsoluteUri |
||
715 | */ |
||
716 | public function testSetSchemeWithEmpty() |
||
723 | |||
724 | /** |
||
725 | * @covers OAuth\Common\Http\Uri\Uri::__construct |
||
726 | * @covers OAuth\Common\Http\Uri\Uri::parseUri |
||
727 | * @covers OAuth\Common\Http\Uri\Uri::setScheme |
||
728 | * @covers OAuth\Common\Http\Uri\Uri::getAbsoluteUri |
||
729 | */ |
||
730 | public function testSetSchemeWithData() |
||
737 | |||
738 | /** |
||
739 | * @covers OAuth\Common\Http\Uri\Uri::__construct |
||
740 | * @covers OAuth\Common\Http\Uri\Uri::parseUri |
||
741 | * @covers OAuth\Common\Http\Uri\Uri::setUserInfo |
||
742 | * @covers OAuth\Common\Http\Uri\Uri::getAbsoluteUri |
||
743 | */ |
||
744 | public function testSetUserInfoEmpty() |
||
751 | |||
752 | /** |
||
753 | * @covers OAuth\Common\Http\Uri\Uri::__construct |
||
754 | * @covers OAuth\Common\Http\Uri\Uri::parseUri |
||
755 | * @covers OAuth\Common\Http\Uri\Uri::setUserInfo |
||
756 | * @covers OAuth\Common\Http\Uri\Uri::protectUserInfo |
||
757 | * @covers OAuth\Common\Http\Uri\Uri::getAbsoluteUri |
||
758 | */ |
||
759 | public function testSetUserInfoWithData() |
||
766 | |||
767 | /** |
||
768 | * @covers OAuth\Common\Http\Uri\Uri::__construct |
||
769 | * @covers OAuth\Common\Http\Uri\Uri::parseUri |
||
770 | * @covers OAuth\Common\Http\Uri\Uri::setPort |
||
771 | * @covers OAuth\Common\Http\Uri\Uri::getAbsoluteUri |
||
772 | */ |
||
773 | public function testSetPortCustom() |
||
780 | |||
781 | /** |
||
782 | * @covers OAuth\Common\Http\Uri\Uri::__construct |
||
783 | * @covers OAuth\Common\Http\Uri\Uri::parseUri |
||
784 | * @covers OAuth\Common\Http\Uri\Uri::setPort |
||
785 | * @covers OAuth\Common\Http\Uri\Uri::getAbsoluteUri |
||
786 | */ |
||
787 | public function testSetPortHttpImplicit() |
||
794 | |||
795 | /** |
||
796 | * @covers OAuth\Common\Http\Uri\Uri::__construct |
||
797 | * @covers OAuth\Common\Http\Uri\Uri::parseUri |
||
798 | * @covers OAuth\Common\Http\Uri\Uri::setPort |
||
799 | * @covers OAuth\Common\Http\Uri\Uri::getAbsoluteUri |
||
800 | */ |
||
801 | public function testSetPortHttpsImplicit() |
||
808 | |||
809 | /** |
||
810 | * @covers OAuth\Common\Http\Uri\Uri::__construct |
||
811 | * @covers OAuth\Common\Http\Uri\Uri::parseUri |
||
812 | * @covers OAuth\Common\Http\Uri\Uri::setPort |
||
813 | * @covers OAuth\Common\Http\Uri\Uri::getAbsoluteUri |
||
814 | */ |
||
815 | public function testSetPortHttpExplicit() |
||
822 | |||
823 | /** |
||
824 | * @covers OAuth\Common\Http\Uri\Uri::__construct |
||
825 | * @covers OAuth\Common\Http\Uri\Uri::parseUri |
||
826 | * @covers OAuth\Common\Http\Uri\Uri::setPort |
||
827 | * @covers OAuth\Common\Http\Uri\Uri::getAbsoluteUri |
||
828 | */ |
||
829 | public function testSetPortHttpsExplicit() |
||
836 | |||
837 | /** |
||
838 | * @covers OAuth\Common\Http\Uri\Uri::__construct |
||
839 | * @covers OAuth\Common\Http\Uri\Uri::parseUri |
||
840 | * @covers OAuth\Common\Http\Uri\Uri::setHost |
||
841 | * @covers OAuth\Common\Http\Uri\Uri::getAbsoluteUri |
||
842 | */ |
||
843 | public function testSetHost() |
||
850 | |||
851 | /** |
||
852 | * @covers OAuth\Common\Http\Uri\Uri::__construct |
||
853 | * @covers OAuth\Common\Http\Uri\Uri::parseUri |
||
854 | * @covers OAuth\Common\Http\Uri\Uri::hasExplicitTrailingHostSlash |
||
855 | */ |
||
856 | public function testHasExplicitTrailingHostSlashTrue() |
||
862 | |||
863 | /** |
||
864 | * @covers OAuth\Common\Http\Uri\Uri::__construct |
||
865 | * @covers OAuth\Common\Http\Uri\Uri::parseUri |
||
866 | * @covers OAuth\Common\Http\Uri\Uri::hasExplicitTrailingHostSlash |
||
867 | */ |
||
868 | public function testHasExplicitTrailingHostSlashFalse() |
||
874 | |||
875 | /** |
||
876 | * @covers OAuth\Common\Http\Uri\Uri::__construct |
||
877 | * @covers OAuth\Common\Http\Uri\Uri::parseUri |
||
878 | * @covers OAuth\Common\Http\Uri\Uri::hasExplicitPortSpecified |
||
879 | */ |
||
880 | public function testHasExplicitPortSpecifiedTrue() |
||
886 | |||
887 | /** |
||
888 | * @covers OAuth\Common\Http\Uri\Uri::__construct |
||
889 | * @covers OAuth\Common\Http\Uri\Uri::parseUri |
||
890 | * @covers OAuth\Common\Http\Uri\Uri::hasExplicitPortSpecified |
||
891 | */ |
||
892 | public function testHasExplicitPortSpecifiedFalse() |
||
898 | } |
||
899 |
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.