From 3968659b9f2a6124a7929f45c77b0706991d3c0a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christian=20Bl=C3=A4ul?= Date: Wed, 21 Feb 2018 19:15:38 +0100 Subject: [PATCH] Make sure the code examples run without syntax or runtime errors. --- tests/methods/ConstructTest.php | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/tests/methods/ConstructTest.php b/tests/methods/ConstructTest.php index a170310..48330ae 100644 --- a/tests/methods/ConstructTest.php +++ b/tests/methods/ConstructTest.php @@ -1,18 +1,18 @@ assertTrue(is_string($this->csv->file_data)); $this->assertEquals($csv, $this->csv->file_data); } + + /** + * @runInSeparateProcess because download.php uses header() + * + * @see https://github.com/sebastianbergmann/phpunit/issues/720#issuecomment-10421092 + */ + public function testCodeExamples() { + foreach (glob('examples/*.php') as $script_file) { + /** @noinspection PhpIncludeInspection */ + require $script_file; + } + } }