From 42b5d30d6637cb3c4f4a5bb551b694ceb9252be6 Mon Sep 17 00:00:00 2001 From: Fonata Date: Sat, 17 Mar 2018 12:37:54 +0100 Subject: [PATCH] Improved OldRequireTest: explanation and new test added (#128) --- ChangeLog.txt | 2 +- tests/methods/OldRequireTest.php | 19 ++++++++++++++++++- 2 files changed, 19 insertions(+), 2 deletions(-) diff --git a/ChangeLog.txt b/ChangeLog.txt index d592923..46bf701 100644 --- a/ChangeLog.txt +++ b/ChangeLog.txt @@ -22,7 +22,7 @@ Date: 3-March-2018 guesses the type of each column. - MIME: output() sends correct MIME type to browser - if the separator is a tab tab (Issue #79). + if the separator is a tab char (Issue #79). - Added support for mb_convert_encoding() instead of iconv() - see issue #109. diff --git a/tests/methods/OldRequireTest.php b/tests/methods/OldRequireTest.php index 6f7adfb..d9abc00 100644 --- a/tests/methods/OldRequireTest.php +++ b/tests/methods/OldRequireTest.php @@ -4,6 +4,11 @@ namespace ParseCsv\tests\methods; use PHPUnit\Framework\TestCase; +/** + * This test checks for backwards compatibility: Does it work to + * - require the old "parsecsv.lib.php" instead of composer autoloading? + * - use the old class name "parseCSV"? + */ class OldRequireTest extends TestCase { protected function setUp() { @@ -15,7 +20,7 @@ class OldRequireTest extends TestCase { } /** - * @runInSeparateProcess because download.php uses header() + * @runInSeparateProcess so that disabled autoloading has an effect */ public function testOldLibWithoutComposer() { @@ -25,4 +30,16 @@ class OldRequireTest extends TestCase { $this->assertEquals($output, []); $this->assertEquals(0, $return_var); } + + /** + * @runInSeparateProcess so that disabled autoloading has an effect + */ + public function testOldLibWithOldClassName() { + + file_put_contents('__eval.php', 'assertEquals($output, []); + $this->assertEquals(0, $return_var); + } }