Make CSV reader return Row objects

This commit is contained in:
Adrien Loison committed 2017-11-18 19:08:27 +01:00
1 parent 139f7fdfb3
commit a665b974fa
37 files changed
+664 -214

No files matched your search

+6 -6
View File
@@ -4,8 +4,8 @@ namespace Box\Spout\Reader\ODS;
use Box\Spout\Common\Exception\IOException;
use Box\Spout\Common\Type;
use Box\Spout\Reader\Common\Creator\EntityFactory;
use Box\Spout\Reader\Exception\IteratorNotRewindableException;
use Box\Spout\Reader\ReaderFactory;
use Box\Spout\TestUsingResource;
/**
@@ -353,7 +353,7 @@ class ReaderTest extends \PHPUnit_Framework_TestCase
$this->expectException(IteratorNotRewindableException::class);
$resourcePath = $this->getResourcePath('one_sheet_with_strings.ods');
$reader = ReaderFactory::create(Type::ODS);
$reader = EntityFactory::createReader(Type::ODS);
$reader->open($resourcePath);
foreach ($reader->getSheetIterator() as $sheet) {
@@ -377,7 +377,7 @@ class ReaderTest extends \PHPUnit_Framework_TestCase
$allRows = [];
$resourcePath = $this->getResourcePath('two_sheets_with_strings.ods');
$reader = ReaderFactory::create(Type::ODS);
$reader = EntityFactory::createReader(Type::ODS);
$reader->open($resourcePath);
foreach ($reader->getSheetIterator() as $sheet) {
@@ -421,7 +421,7 @@ class ReaderTest extends \PHPUnit_Framework_TestCase
$this->expectException(IOException::class);
/** @var \Box\Spout\Reader\ODS\Reader $reader */
$reader = ReaderFactory::create(Type::ODS);
$reader = EntityFactory::createReader(Type::ODS);
$reader->open('unsupported://foobar');
}
@@ -433,7 +433,7 @@ class ReaderTest extends \PHPUnit_Framework_TestCase
$this->expectException(IOException::class);
/** @var \Box\Spout\Reader\ODS\Reader $reader */
$reader = ReaderFactory::create(Type::ODS);
$reader = EntityFactory::createReader(Type::ODS);
$reader->open('php://memory');
}
@@ -529,7 +529,7 @@ class ReaderTest extends \PHPUnit_Framework_TestCase
$resourcePath = $this->getResourcePath($fileName);
/** @var \Box\Spout\Reader\ODS\Reader $reader */
$reader = ReaderFactory::create(Type::ODS);
$reader = EntityFactory::createReader(Type::ODS);
$reader->setShouldFormatDates($shouldFormatDates);
$reader->setShouldPreserveEmptyRows($shouldPreserveEmptyRows);
$reader->open($resourcePath);