From 7eb6daa6fb6009a6e869eafa9a0a61093f39cc7e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christian=20Bl=C3=A4ul?= Date: Thu, 2 Nov 2017 22:05:30 +0100 Subject: [PATCH] Added file parse_test.php to check for 'is_readable' warning As documented in pull request #67 --- tests/methods/parse_test.php | 41 ++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 tests/methods/parse_test.php diff --git a/tests/methods/parse_test.php b/tests/methods/parse_test.php new file mode 100644 index 0000000..a9f9563 --- /dev/null +++ b/tests/methods/parse_test.php @@ -0,0 +1,41 @@ +csv = new parseCSV(); + } + + public function test_parse() { + // can we trick 'is_readable' into whining? See #67. + $this->parse_repetitive_string('c:/looks/like/a/path'); + $this->parse_repetitive_string('http://looks/like/an/url'); + } + + private function parse_repetitive_string($content) { + $this->csv->delimiter = ';'; + $this->csv->heading = FALSE; + $success = $this->csv->parse(str_repeat($content . ';', 500)); + $this->assertEquals(TRUE, $success); + + $row = array_pop($this->csv->data); + $expected_data = array_fill(0, 500, $content); + $expected_data [] = ''; + $this->assertEquals($expected_data, $row); + } +}