mirror of
https://github.com/parsecsv/parsecsv-for-php.git
synced 2026-02-19 08:36:39 +00:00
37 lines
728 B
PHP
37 lines
728 B
PHP
<?php
|
|
|
|
namespace ParseCsv\tests\properties;
|
|
|
|
use ParseCsv\Csv;
|
|
use PHPUnit\Framework\TestCase;
|
|
|
|
class BaseClass extends TestCase {
|
|
|
|
/**
|
|
* CSV
|
|
* The parseCSV object
|
|
*
|
|
* @access protected
|
|
* @var Csv
|
|
*/
|
|
protected $csv;
|
|
|
|
/**
|
|
* Setup
|
|
* Setup our test environment objects
|
|
*
|
|
* @access public
|
|
*/
|
|
public function setUp() {
|
|
$this->csv = new Csv();
|
|
}
|
|
|
|
protected function _compareWithExpected($expected) {
|
|
$this->csv->auto(__DIR__ . '/../../examples/_books.csv');
|
|
$actual = array_map(function ($row) {
|
|
return $row['title'];
|
|
}, $this->csv->data);
|
|
$this->assertEquals($expected, array_values($actual));
|
|
}
|
|
}
|