mirror of
https://github.com/parsecsv/parsecsv-for-php.git
synced 2026-02-19 08:36:39 +00:00
Added PHPUnit test for sorting; I could not get the rows in the right...
order without calling array_values - maybe this helps just PHPUnit. I consider the risk of breaking library users' code unlikely.
This commit is contained in:
31
tests/properties/BaseClass.php
Normal file
31
tests/properties/BaseClass.php
Normal file
@@ -0,0 +1,31 @@
|
||||
<?php
|
||||
|
||||
class BaseClass extends PHPUnit\Framework\TestCase {
|
||||
|
||||
/**
|
||||
* CSV
|
||||
* The parseCSV object
|
||||
*
|
||||
* @access protected
|
||||
* @var parseCSV
|
||||
*/
|
||||
protected $csv;
|
||||
|
||||
/**
|
||||
* Setup
|
||||
* Setup our test environment objects
|
||||
*
|
||||
* @access public
|
||||
*/
|
||||
public function setUp() {
|
||||
$this->csv = new parseCSV();
|
||||
}
|
||||
|
||||
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, $actual);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user