From 7722bd06a2797d06529d21fc939cd84ae98361fe Mon Sep 17 00:00:00 2001
From: Christian Schneider
Date: Thu, 30 Aug 2007 13:43:13 +0000
Subject:
---
it_html.class | 4 ++--
tests/it.t | 18 +++++++++---------
tests/it_html.t | 18 +++++++++---------
tests/it_xml.t | 2 +-
4 files changed, 21 insertions(+), 21 deletions(-)
diff --git a/it_html.class b/it_html.class
index af0ab26..f05003d 100644
--- a/it_html.class
+++ b/it_html.class
@@ -263,7 +263,7 @@ function sanitize($html)
$result .= it_html::sanitize($head) . "<$tagname />" . it_html::sanitize($tail);
}
else
- $result = it_html::Q(it::replace('\d+;' => "", html_entity_decode(strip_tags($html))));
+ $result = it_html::Q(it::replace(array('\d+;' => ""), html_entity_decode(strip_tags($html))));
return $result;
}
@@ -506,7 +506,7 @@ function head($args = array())
$checksum = itjs::checksum(itjs::filenames($p['js']));
$js .= $this->_itjs("boot.js", "inline");
$js .= "function it_boot_start(){ " . trim($p['jsboot']) . " }\n";
- $js .= "it_boot('/itjs/" . it_html::U($p['js'], 's' => $checksum) . "');\n";
+ $js .= "it_boot('/itjs/" . it_html::U($p['js'], array('s' => $checksum)) . "');\n";
}
$js .= $this->_itjs($p['jsinline'], 'inline');
diff --git a/tests/it.t b/tests/it.t
index 9ae2a5c..e399c72 100755
--- a/tests/it.t
+++ b/tests/it.t
@@ -123,7 +123,7 @@ match(
match(
'[\w]+', ' \\\\aword[[[]]] ',
'aword',
- 'replace \w in [\w] correctly (match)',
+ 'replace \w in [\w] correctly (match)'
);
match(
'[\\\\w]+', ' blabergna ',
@@ -133,7 +133,7 @@ match(
match(
'[\\\\w]+', ' \\\\worda[[[]',
'\\\\w',
- 'don\'t parse \w in [\\\\w] (match)',
+ 'don\'t parse \w in [\\\\w] (match)'
);
match(
'[a\W]+', 'bbbbbbb a a%$+ accccc',
@@ -161,7 +161,7 @@ is(
'test tr regex function'
);
is(
- it::match( '\w+', 'word1 wörd2 word_3', 'all' => true ),
+ it::match( '\w+', 'word1 wörd2 word_3', array('all' => true )),
array( 'word1', 'wörd2', 'word_3' ),
"test match_all function"
);
@@ -176,29 +176,29 @@ match(
'match umlaute in latin1 case insensitive'
);
is(
- it::match( 'abc', "aBc", 'casesensitive' => 1 ),
+ it::match( 'abc', "aBc", array('casesensitive' => 1 )),
false,
"set case sensitivity by parameter"
);
is(
- it::match( '\w+', 'word1 wörd2 word_3', 'all' => 1 ),
+ it::match( '\w+', 'word1 wörd2 word_3', array('all' => 1 )),
array( 'word1', 'wörd2', 'word_3' ),
"test all=>1 without captures"
);
is(
- it::match( '\w+\s+(\d+)', 'word1 12 wörd2 3 word_3 4', 'all' => 1 ),
+ it::match( '\w+\s+(\d+)', 'word1 12 wörd2 3 word_3 4', array('all' => 1 )),
array( '12', '3', '4' ),
"test all=>1 with one capture"
);
is(
- it::match( '(\w+)\s+(\d+)', 'word1 12 wörd2 3 word_3 4', 'all' => 1 ),
+ it::match( '(\w+)\s+(\d+)', 'word1 12 wörd2 3 word_3 4', array('all' => 1 )),
array( array( 'word1', '12' ), array( 'wörd2', '3' ), array( 'word_3', '4' ) ),
"test all=>1 with captures"
);
is(
- it::match( '(\w+)\s+(\d+)', 'word1 12 wörd2 3 word_3 4', 'all' => 1, 'pattern_order' => 1 ),
+ it::match( '(\w+)\s+(\d+)', 'word1 12 wörd2 3 word_3 4', array('all' => 1, 'pattern_order' => 1 )),
array( array( 'word1', 'wörd2', 'word_3' ), array( '12', '3', '4' ) ),
- "test all=>1,pattern_order=>1",
+ "test all=>1,pattern_order=>1"
);
?>
diff --git a/tests/it_html.t b/tests/it_html.t
index 965e4a1..cd934be 100755
--- a/tests/it_html.t
+++ b/tests/it_html.t
@@ -6,10 +6,10 @@
require 'searchlib/search_test.class';
# Traditional html generation
-new it_html('htmltype' => "html");
+new it_html(array('htmltype' => "html"));
is(
- a('href' => "&foo", 'true' => true, 'false' => false, 'null' => null, 'empty' => "", "bar"),
+ a(array('href' => "&foo", 'true' => true, 'false' => false, 'null' => null, 'empty' => ""), "bar"),
'bar',
"tag with attributes"
);
@@ -21,7 +21,7 @@ is(
);
is(
- img('src' => "foo.png"),
+ img(array('src' => "foo.png")),
'',
"empty link tag"
);
@@ -40,7 +40,7 @@ is(
# XML generation
unset($GLOBALS['it_html']);
-new it_html('htmltype' => "xhtml", 'tags' => "xmltest");
+new it_html(array('htmltype' => "xhtml", 'tags' => "xmltest"));
is(
xmltest(),
@@ -55,7 +55,7 @@ is(
);
is(
- xmltest('href' => "&foo", 'true' => true, 'false' => false, 'null' => null, 'empty' => ""),
+ xmltest(array('href' => "&foo", 'true' => true, 'false' => false, 'null' => null, 'empty' => "")),
'' . "\n",
"xmltest tag with attributes"
);
@@ -65,17 +65,17 @@ class myhtml extends it_html
{
function myimg($args)
{
- array_unshift($args, 'alt' => "ALT", 'bar' => "BAR");
+ array_unshift($args, array('alt' => "ALT", 'bar' => "BAR"));
return parent::img($args);
}
}
unset($GLOBALS['it_html']);
-new myhtml('htmltype' => "html");
+new myhtml(array('htmltype' => "html"));
is(
- myimg('src' => "foo.gif", 'alt' => "foo"),
+ myimg(array('src' => "foo.gif", 'alt' => "foo")),
'',
"it_html inheritance"
);
@@ -90,7 +90,7 @@ is(
);
is(
- U("/foo.html", 'bar' => array('gna' => 42, 'qux' => array('quux' => "", 'gnöp' => "fasel"))),
+ U("/foo.html", array('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_xml.t b/tests/it_xml.t
index 5d652cc..5651fbe 100755
--- a/tests/it_xml.t
+++ b/tests/it_xml.t
@@ -14,7 +14,7 @@ function match($xmldata, $expected, $name, $prefix = "")
is(
preg_replace('/[#\s]+/', " ", print_r($xml->$varname, true)),
$expected,
- $name,
+ $name
);
}
--
cgit v1.2.3