From 6022d924c7ac70a13d1782f2f1199f9ef45c947c Mon Sep 17 00:00:00 2001 From: Urban Müller Date: Thu, 9 Jan 2014 14:25:57 +0100 Subject: allow column name override, add tests --- tests/it_pipe.t | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100755 tests/it_pipe.t (limited to 'tests') diff --git a/tests/it_pipe.t b/tests/it_pipe.t new file mode 100755 index 0000000..c65073d --- /dev/null +++ b/tests/it_pipe.t @@ -0,0 +1,7 @@ +#!/www/server/bin/php + 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()"); -- cgit v1.2.3