summaryrefslogtreecommitdiff
path: root/tests/it_url.t
diff options
context:
space:
mode:
authorChristian Schneider2007-10-11 00:39:30 +0000
committerChristian Schneider2007-10-11 00:39:30 +0000
commit35fe33f7364329dacf415c950bff01b6de9ef88e (patch)
treeb0e6b018b50038ca20266723c53750268f508df5 /tests/it_url.t
parent1f95711ff3e9697cd85a54545ab42e5fd3611317 (diff)
downloaditools-35fe33f7364329dacf415c950bff01b6de9ef88e.tar.gz
itools-35fe33f7364329dacf415c950bff01b6de9ef88e.tar.bz2
itools-35fe33f7364329dacf415c950bff01b6de9ef88e.zip
Populated release branch
Diffstat (limited to 'tests/it_url.t')
-rwxr-xr-xtests/it_url.t70
1 files changed, 70 insertions, 0 deletions
diff --git a/tests/it_url.t b/tests/it_url.t
new file mode 100755
index 0000000..bc63bcb
--- /dev/null
+++ b/tests/it_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'
+);
+
+?>