UnparseUrlTest.php 619 B

12345678910111213141516171819202122232425262728293031
  1. <?php
  2. /**
  3. * Unpares Url's tests
  4. */
  5. require_once 'application/Url.php';
  6. /**
  7. * Unitary tests for unparse_url()
  8. */
  9. class UnparseUrlTest extends PHPUnit_Framework_TestCase
  10. {
  11. /**
  12. * Thanks for building nothing
  13. */
  14. public function testUnparseEmptyArray()
  15. {
  16. $this->assertEquals('', unparse_url(array()));
  17. }
  18. /**
  19. * Rebuild a full-featured URL
  20. */
  21. public function testUnparseFull()
  22. {
  23. $ref = 'http://username:password@hostname:9090/path'
  24. .'?arg1=value1&arg2=value2#anchor';
  25. $this->assertEquals($ref, unparse_url(parse_url($ref)));
  26. }
  27. }