- add/update tests
authorMichael Wallner <mike@php.net>
Fri, 27 Jan 2006 10:17:30 +0000 (10:17 +0000)
committerMichael Wallner <mike@php.net>
Fri, 27 Jan 2006 10:17:30 +0000 (10:17 +0000)
tests/build_url_002.phpt
tests/build_url_004.phpt [new file with mode: 0644]

index 9edac56e236c8976ebb6f24a1313ae6ada822f37..dbaa93723b95db91685702558efbfa184b10ebd4 100644 (file)
@@ -10,7 +10,7 @@ echo "-TEST\n";
 echo http_build_url(parse_url("http://example.org/orig?q=1#f"), 
        parse_url("https://www.example.com:9999/replaced#n")), "\n";
 echo http_build_url(("http://example.org/orig?q=1#f"), 
-       ("https://www.example.com:9999/replaced#n"), $u), "\n";
+       ("https://www.example.com:9999/replaced#n"), 0, $u), "\n";
 print_r($u);
 echo "Done\n";
 ?>
diff --git a/tests/build_url_004.phpt b/tests/build_url_004.phpt
new file mode 100644 (file)
index 0000000..118ca7e
--- /dev/null
@@ -0,0 +1,22 @@
+--TEST--
+http_build_url flags
+--SKPIF--
+<?php
+include 'skip.inc';
+?>
+--FILE--
+<?php
+echo "-TEST\n";
+echo http_build_url("http://mike@www.example.com/foo/bar", "./baz", HTTP_URL_STRIP_AUTH|HTTP_URL_JOIN_PATH), "\n";
+echo http_build_url("http://mike@www.example.com/foo/bar/", "../baz", HTTP_URL_STRIP_USER|HTTP_URL_JOIN_PATH), "\n";
+echo http_build_url("http://mike:1234@www.example.com/foo/bar/", "./../baz", HTTP_URL_STRIP_PASS|HTTP_URL_JOIN_PATH), "\n";
+echo http_build_url("http://www.example.com:8080/foo?a=b#frag", "?b=c", HTTP_URL_JOIN_QUERY|HTTP_URL_STRIP_PORT|HTTP_URL_STRIP_FRAGMENT|HTTP_URL_STRIP_PATH), "\n";
+echo "Done\n";
+?>
+--EXPECTF--
+%sTEST
+http://www.example.com/foo/baz
+http://www.example.com/foo/baz
+http://mike@www.example.com/foo/baz
+http://www.example.com/?a=b&b=c
+Done
\ No newline at end of file