From 806a5297e7e99d455b97a4f0acaba2f40f470584 Mon Sep 17 00:00:00 2001 From: Urban Müller Date: Thu, 26 Jul 2007 13:02:24 +0000 Subject: renamed files for autoloader --- tests/html.t | 99 --------------------------------------------------------- tests/it_html.t | 99 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++ tests/it_url.t | 70 ++++++++++++++++++++++++++++++++++++++++ tests/it_xml.t | 70 ++++++++++++++++++++++++++++++++++++++++ tests/url.t | 70 ---------------------------------------- tests/xml.t | 70 ---------------------------------------- 6 files changed, 239 insertions(+), 239 deletions(-) delete mode 100755 tests/html.t create mode 100755 tests/it_html.t create mode 100755 tests/it_url.t create mode 100755 tests/it_xml.t delete mode 100755 tests/url.t delete mode 100755 tests/xml.t (limited to 'tests') diff --git a/tests/html.t b/tests/html.t deleted file mode 100755 index 965e4a1..0000000 --- a/tests/html.t +++ /dev/null @@ -1,99 +0,0 @@ -#!/www/server/bin/php -qC - "html"); - -is( - a('href' => "&foo", 'true' => true, 'false' => false, 'null' => null, 'empty' => "", "bar"), - 'bar', - "tag with attributes" -); - -is( - div(), - "
\n", - "empty script tag" -); - -is( - img('src' => "foo.png"), - '', - "empty link tag" -); - -is( - tag('link'), - "\n", - "empty link tag" -); - -is( - tag('link', "foo"), - "foo\n", - "link tag with data" -); - -# XML generation -unset($GLOBALS['it_html']); -new it_html('htmltype' => "xhtml", 'tags' => "xmltest"); - -is( - xmltest(), - "\n", - "empty xmltest tag" -); - -is( - xmltest("foo"), - "foo\n", - "empty xmltest tag" -); - -is( - xmltest('href' => "&foo", 'true' => true, 'false' => false, 'null' => null, 'empty' => ""), - '' . "\n", - "xmltest tag with attributes" -); - -# Inheriting and extending it_html -class myhtml extends it_html -{ -function myimg($args) -{ - array_unshift($args, 'alt' => "ALT", 'bar' => "BAR"); - - return parent::img($args); -} -} - -unset($GLOBALS['it_html']); -new myhtml('htmltype' => "html"); - -is( - myimg('src' => "foo.gif", 'alt' => "foo"), - 'foo', - "it_html inheritance" -); - -is( - it_html::sanitize('

swisspics posted < < ä & yesterday a photo tag missmatch:



- -

Wolken

-'), - ' swisspics posted < < ä & yesterday a photo tag missmatch:

', - 'it_html::sanitize tag soup' -); - -is( - U("/foo.html", 'bar' => array('gna' => 42, 'qux' => array('quux' => "", 'gnöp' => "fasel"))), - '/foo.html?bar[gna]=42&bar[qux][quux]=%3CZ%FCrich%3E&bar[qux][gn%F6p]=fasel', - 'U() with nested arrays' -); - - -?> diff --git a/tests/it_html.t b/tests/it_html.t new file mode 100755 index 0000000..965e4a1 --- /dev/null +++ b/tests/it_html.t @@ -0,0 +1,99 @@ +#!/www/server/bin/php -qC + "html"); + +is( + a('href' => "&foo", 'true' => true, 'false' => false, 'null' => null, 'empty' => "", "bar"), + 'bar', + "tag with attributes" +); + +is( + div(), + "
\n", + "empty script tag" +); + +is( + img('src' => "foo.png"), + '', + "empty link tag" +); + +is( + tag('link'), + "\n", + "empty link tag" +); + +is( + tag('link', "foo"), + "foo\n", + "link tag with data" +); + +# XML generation +unset($GLOBALS['it_html']); +new it_html('htmltype' => "xhtml", 'tags' => "xmltest"); + +is( + xmltest(), + "\n", + "empty xmltest tag" +); + +is( + xmltest("foo"), + "foo\n", + "empty xmltest tag" +); + +is( + xmltest('href' => "&foo", 'true' => true, 'false' => false, 'null' => null, 'empty' => ""), + '' . "\n", + "xmltest tag with attributes" +); + +# Inheriting and extending it_html +class myhtml extends it_html +{ +function myimg($args) +{ + array_unshift($args, 'alt' => "ALT", 'bar' => "BAR"); + + return parent::img($args); +} +} + +unset($GLOBALS['it_html']); +new myhtml('htmltype' => "html"); + +is( + myimg('src' => "foo.gif", 'alt' => "foo"), + 'foo', + "it_html inheritance" +); + +is( + it_html::sanitize('

swisspics posted < < ä & yesterday a photo tag missmatch:



+ +

Wolken

+'), + ' swisspics posted < < ä & yesterday a photo tag missmatch:

', + 'it_html::sanitize tag soup' +); + +is( + U("/foo.html", 'bar' => array('gna' => 42, 'qux' => array('quux' => "", 'gnöp' => "fasel"))), + '/foo.html?bar[gna]=42&bar[qux][quux]=%3CZ%FCrich%3E&bar[qux][gn%F6p]=fasel', + 'U() with nested arrays' +); + + +?> 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 +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' +); + +?> diff --git a/tests/it_xml.t b/tests/it_xml.t new file mode 100755 index 0000000..5d652cc --- /dev/null +++ b/tests/it_xml.t @@ -0,0 +1,70 @@ +#!/www/server/bin/php -qC +$xmldata"); + + is( + preg_replace('/[#\s]+/', " ", print_r($xml->$varname, true)), + $expected, + $name, + ); +} + +match( + '', + 'foo Object ( ) ', + 'empty tag' +); + +match( + '', + 'Array ( [0] => foo Object ( ) [1] => foo Object ( ) ) ', + 'multiple empty tags converted to array' +); + +match( + 'Stüssihofstadt', + 'foo Object ( [attr] => Array ( [title] => Zürich ) [val] => Stüssihofstadt ) ', + 'simple tag with latin1 content and attribute' +); + +match( + '', + 'foo Object ( [a_b__c] => a_b__c Object ( [attr] => Array ( [d_e_f] => value ) ) ) ', + 'Tags and attributes with name space and special characters' +); + +# Test inheritance +class my_xml extends it_xml +{ + +function my_xml($xmldata) +{ + parent::it_xml($xmldata); + + # Code which should be executed in root and only there + $this->qux = new it_xml; + $this->qux->val = "qux"; + + if (is_object($this->myfoo)) + $this->myfoo->inheritbaseclass = is_a($this->myfoo, "my_xml"); +} + +} + +match( + '', + 'myfoo Object ( [inheritbaseclass] => ) ', + 'Inheritance and constructor (critical for e.g. tel_xmlentry)', + 'my' +); + +?> diff --git a/tests/url.t b/tests/url.t deleted file mode 100755 index bc63bcb..0000000 --- a/tests/url.t +++ /dev/null @@ -1,70 +0,0 @@ -#!/www/server/bin/php -qC -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' -); - -?> diff --git a/tests/xml.t b/tests/xml.t deleted file mode 100755 index 5d652cc..0000000 --- a/tests/xml.t +++ /dev/null @@ -1,70 +0,0 @@ -#!/www/server/bin/php -qC -$xmldata"); - - is( - preg_replace('/[#\s]+/', " ", print_r($xml->$varname, true)), - $expected, - $name, - ); -} - -match( - '', - 'foo Object ( ) ', - 'empty tag' -); - -match( - '', - 'Array ( [0] => foo Object ( ) [1] => foo Object ( ) ) ', - 'multiple empty tags converted to array' -); - -match( - 'Stüssihofstadt', - 'foo Object ( [attr] => Array ( [title] => Zürich ) [val] => Stüssihofstadt ) ', - 'simple tag with latin1 content and attribute' -); - -match( - '', - 'foo Object ( [a_b__c] => a_b__c Object ( [attr] => Array ( [d_e_f] => value ) ) ) ', - 'Tags and attributes with name space and special characters' -); - -# Test inheritance -class my_xml extends it_xml -{ - -function my_xml($xmldata) -{ - parent::it_xml($xmldata); - - # Code which should be executed in root and only there - $this->qux = new it_xml; - $this->qux->val = "qux"; - - if (is_object($this->myfoo)) - $this->myfoo->inheritbaseclass = is_a($this->myfoo, "my_xml"); -} - -} - -match( - '', - 'myfoo Object ( [inheritbaseclass] => ) ', - 'Inheritance and constructor (critical for e.g. tel_xmlentry)', - 'my' -); - -?> -- cgit v1.2.3