1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
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'
);
?>
|