summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorChristian Schneider2019-09-02 17:14:43 +0200
committerChristian Schneider2019-09-02 17:14:43 +0200
commit2b13737e9299317c865f72f4a276ea0b733c4f5f (patch)
treeb800cc0e889d976ba0957e168df45622aee24ee2 /test
parentb422951038a66713c18ec4d24ce71a13dd0756a6 (diff)
downloaditools-2b13737e9299317c865f72f4a276ea0b733c4f5f.tar.gz
itools-2b13737e9299317c865f72f4a276ea0b733c4f5f.tar.bz2
itools-2b13737e9299317c865f72f4a276ea0b733c4f5f.zip
Make itools a bit stricter, new PHP versions start to enforce more declarations
Diffstat (limited to 'test')
-rwxr-xr-xtest/it.t3
-rwxr-xr-xtest/it_html.t4
-rwxr-xr-xtest/it_xml.t2
3 files changed, 5 insertions, 4 deletions
diff --git a/test/it.t b/test/it.t
index b624f96..0e2b06d 100755
--- a/test/it.t
+++ b/test/it.t
@@ -445,7 +445,8 @@ is(it::map('5*$k+$v', array(0 => 1, 1 => 2)), array(1, 7));
is(it::map(function($k, $v) {return 5*$k+$v;}, array(0 => 1, 1 => 2)), array(1, 7));
is(it::map('strlen', array("aaa", "aa")), array(3, 2));
is(it::map('it::ucfirst', array("aaa")), array("Aaa"));
-is(it::map('$v->C14N()', DOMDocument::loadXML('<foo>42</foo>')->childNodes), [ '<foo>42</foo>' ], "Traversable: Needs copy, not modifiable in-place");
+($dom = new DOMDocument)->loadXML('<foo>42</foo>');
+is(it::map('$v->C14N()', $dom->childNodes), [ '<foo>42</foo>' ], "Traversable: Needs copy, not modifiable in-place");
# Special values which are not callable
is(it::map('null', array("aaa", "aa")), array(null, null));
is(it::map('1', array("aaa", "aa")), array(1, 1));
diff --git a/test/it_html.t b/test/it_html.t
index 5e19b74..f5daebd 100755
--- a/test/it_html.t
+++ b/test/it_html.t
@@ -175,7 +175,7 @@ is(
class myhtml extends it_html
{
-function myhtml($p = array())
+function __construct($p = array())
{
parent::__construct($p + ['moretags' => 'overriddentag,defaulttag', 'nonewlinetags' => 'a,b,defaulttag,em,img,input,overriddentag,span,div']);
}
@@ -253,7 +253,7 @@ is(
'empty tags removal'
);
-foreach (json_decode(file_get_contents(dirname($argv[0]) . '/U_tests.json'), true) as $test) {
+foreach (json_decode(it::file_get_contents(dirname($argv[0]) . '/U_tests.json'), true) as $test) {
is(U(...$test['args']), $test['exp'], $test['name']);
}
diff --git a/test/it_xml.t b/test/it_xml.t
index 4df340a..84f258f 100755
--- a/test/it_xml.t
+++ b/test/it_xml.t
@@ -95,7 +95,7 @@ match(
class my_xml extends it_xml
{
-function my_xml($xmldata)
+function __construct($xmldata)
{
parent::__construct($xmldata);