summaryrefslogtreecommitdiff
path: root/tests/it_pipe.t
diff options
context:
space:
mode:
authorDavid Flatz2016-02-03 18:12:16 +0100
committerDavid Flatz2016-02-03 18:25:21 +0100
commit06dbabffb1d0cbae2a707968b2cd34a996d23171 (patch)
tree374a9c8b9e9535dd228da4a2d8b2e874241b46b6 /tests/it_pipe.t
parenteb55ac5cea8ad3720505645600e6d854d737603a (diff)
downloaditools-06dbabffb1d0cbae2a707968b2cd34a996d23171.tar.gz
itools-06dbabffb1d0cbae2a707968b2cd34a996d23171.tar.bz2
itools-06dbabffb1d0cbae2a707968b2cd34a996d23171.zip
make tests compatible to php 5.3 std
Diffstat (limited to 'tests/it_pipe.t')
-rwxr-xr-xtests/it_pipe.t19
1 files changed, 14 insertions, 5 deletions
diff --git a/tests/it_pipe.t b/tests/it_pipe.t
index ce55469..56ee672 100755
--- a/tests/it_pipe.t
+++ b/tests/it_pipe.t
@@ -2,8 +2,17 @@
<?php
# csv()
-is(json_encode((new it_pipe('data' => array("a\tb", "1\t2")))->csv()), '[{"a":"1","b":"2"}]', "it_pipe::csv()");
-is(json_encode((new it_pipe('data' => array("a;b", "1;2")))->csv()), '[{"a":"1","b":"2"}]', "it_pipe::csv()");
-is(json_encode((new it_pipe('data' => array("a,b", "1,2")))->csv()), '[{"a":"1","b":"2"}]', "it_pipe::csv()");
-is(json_encode((new it_pipe('data' => array("a\tb", "1\t2")))->csv("c,d")), '[{"c":"1","d":"2"}]', "it_pipe::csv()");
-is(json_encode((new it_pipe('data' => array("\t", "1\t2")))->csv()), '[{"field0":"1","field1":"2"}]', "it_pipe::csv()");
+$pipe = new it_pipe(array('data' => array("a\tb", "1\t2")));
+is(json_encode($pipe->csv()), '[{"a":"1","b":"2"}]', "it_pipe::csv()");
+
+$pipe = new it_pipe(array('data' => array("a;b", "1;2")));
+is(json_encode($pipe->csv()), '[{"a":"1","b":"2"}]', "it_pipe::csv()");
+
+$pipe = new it_pipe(array('data' => array("a,b", "1,2")));
+is(json_encode($pipe->csv()), '[{"a":"1","b":"2"}]', "it_pipe::csv()");
+
+$pipe = new it_pipe(array('data' => array("a\tb", "1\t2")));
+is(json_encode($pipe->csv("c,d")), '[{"c":"1","d":"2"}]', "it_pipe::csv()");
+
+$pipe = new it_pipe(array('data' => array("\t", "1\t2")));
+is(json_encode($pipe->csv()), '[{"field0":"1","field1":"2"}]', "it_pipe::csv()");