Make ODS reader return Row object

This commit is contained in:
Adrien Loison committed 2017-11-19 01:36:18 +01:00
1 parent 68a96367a8
commit 102e17159c
16 files changed
+301 -67

No files matched your search

@@ -3,6 +3,7 @@
namespace Box\Spout\Reader\XLSX\Helper;
use Box\Spout\Common\Helper\Escaper;
use Box\Spout\Reader\Exception\InvalidValueException;
use Box\Spout\Reader\XLSX\Manager\StyleManager;
/**
@@ -96,13 +97,18 @@ class CellValueFormatterTest extends \PHPUnit_Framework_TestCase
->will($this->returnValue(true));
$formatter = new CellValueFormatter(null, $styleManagerMock, false, $shouldUse1904Dates, new Escaper\XLSX());
$result = $formatter->extractAndFormatNodeValue($nodeMock);
if ($expectedDateAsString === null) {
$this->assertNull($result);
} else {
$this->assertInstanceOf('DateTime', $result);
$this->assertSame($expectedDateAsString, $result->format('Y-m-d H:i:s'));
try {
$result = $formatter->extractAndFormatNodeValue($nodeMock);
if ($expectedDateAsString === null) {
$this->fail('An exception should have been thrown');
} else {
$this->assertInstanceOf('DateTime', $result);
$this->assertSame($expectedDateAsString, $result->format('Y-m-d H:i:s'));
}
} catch (InvalidValueException $exception) {
// do nothing
}
}
@@ -9,7 +9,7 @@ use Box\Spout\Reader\XLSX\Creator\InternalEntityFactory;
use Box\Spout\Reader\XLSX\Creator\ManagerFactory;
/**
* Class SharedStringsManagerTest
* Class RowManagerTest
*/
class RowManagerTest extends \PHPUnit_Framework_TestCase
{