mirror of
https://github.com/parsecsv/parsecsv-for-php.git
synced 2026-02-19 08:36:39 +00:00
Make sure the code examples run without syntax or runtime errors.
This commit is contained in:
@@ -1,18 +1,18 @@
|
||||
<?php
|
||||
|
||||
namespace ParseCsv\tests\methods;
|
||||
|
||||
use ParseCsv\Csv;
|
||||
use PHPUnit\Framework\TestCase;
|
||||
|
||||
class ConstructTest extends TestCase
|
||||
{
|
||||
class ConstructTest extends TestCase {
|
||||
|
||||
/**
|
||||
* CSV
|
||||
* The Csv object
|
||||
*
|
||||
* @access protected
|
||||
* @var [Csv]
|
||||
* @var Csv
|
||||
*/
|
||||
protected $csv = null;
|
||||
|
||||
@@ -71,4 +71,16 @@ class ConstructTest extends TestCase
|
||||
$this->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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user