summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorChristian Weber2007-04-04 14:25:07 +0000
committerChristian Weber2007-04-04 14:25:07 +0000
commitfdeb982affccccf5002ff7b550e35261996d86b3 (patch)
tree654b88f1b3db65686bc3b94d314011e677c8eb78 /tests
parent1e3ea65767a2337610a35406460dbae1875945b9 (diff)
downloaditools-fdeb982affccccf5002ff7b550e35261996d86b3.tar.gz
itools-fdeb982affccccf5002ff7b550e35261996d86b3.tar.bz2
itools-fdeb982affccccf5002ff7b550e35261996d86b3.zip
add support for username:password@, user it_url::params to encode params in get(), minor cleanup, add test suite
Diffstat (limited to 'tests')
-rwxr-xr-xtests/url.t70
1 files changed, 70 insertions, 0 deletions
diff --git a/tests/url.t b/tests/url.t
new file mode 100755
index 0000000..bc63bcb
--- /dev/null
+++ b/tests/url.t
@@ -0,0 +1,70 @@
+#!/www/server/bin/php -qC
+<?php
+
+# Tests for url.class, currently only constructor's parser
+
+require 'searchlib/search_test.class';
+
+# Create object and parse url
+$url = new it_url('HTTP://falcon:joshua@www.Relog.CH:80/default.asp');
+
+plan(9);
+
+is(
+ $url->url,
+ 'http://www.relog.ch/',
+ '$url->url'
+);
+
+is(
+ $url->protocol,
+ 'http',
+ '$url->protocol'
+);
+
+is(
+ $url->hostname,
+ 'relog.ch',
+ '$url->hostname'
+);
+
+is(
+ $url->realhostname,
+ 'www.relog.ch',
+ '$url->realhostname'
+);
+
+is(
+ $url->port,
+ 80,
+ '$url->port'
+);
+
+is(
+ $url->path,
+ '',
+ '$url->path'
+);
+
+is(
+ $url->user,
+ 'falcon',
+ '$url->user'
+);
+
+is(
+ $url->pass,
+ 'joshua',
+ '$url->pass'
+);
+
+# and now check for path
+$url = new it_url('HTTP://falcon:joshua@www.Relog.CH:80/foo/bar.html');
+
+is(
+ $url->path,
+ 'foo/bar.html',
+ '$url->path'
+);
+
+?>