diff options
author | ignace nyamagana butera <nyamsprod@gmail.com> | 2015-11-24 12:00:26 +0100 |
---|---|---|
committer | ignace nyamagana butera <nyamsprod@gmail.com> | 2015-11-24 12:00:26 +0100 |
commit | bfcc2d633a0160853684ecd0c9c82b6e3b3d32ef (patch) | |
tree | 0782a13735eac74199f11b63493f6e1808e3b2a0 /test/FactoryTest.php | |
parent | 69bafa6ff924fbf9effe4275d6eb16be81a853ef (diff) | |
parent | c3a2ae5ccdc2ea05de734716f892d9b7f5f28774 (diff) | |
download | csv-bfcc2d633a0160853684ecd0c9c82b6e3b3d32ef.zip csv-bfcc2d633a0160853684ecd0c9c82b6e3b3d32ef.tar.gz csv-bfcc2d633a0160853684ecd0c9c82b6e3b3d32ef.tar.bz2 |
Merge pull request #137 from nyamsprod/features/improve-reader
Reader class complete rewrite
Diffstat (limited to 'test/FactoryTest.php')
-rw-r--r-- | test/FactoryTest.php | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/test/FactoryTest.php b/test/FactoryTest.php index e35b402..f696176 100644 --- a/test/FactoryTest.php +++ b/test/FactoryTest.php @@ -2,7 +2,7 @@ namespace League\Csv\Test; -use DateTime; +use ArrayIterator; use League\Csv\Reader; use SplFileInfo; use SplFileObject; @@ -15,21 +15,21 @@ class FactoryTest extends AbstractTestCase { public function testCreateFromPathWithFilePath() { - $path = __DIR__.'/foo.csv'; + $path = __DIR__.'/data/foo.csv'; $csv = Reader::createFromPath($path); $this->assertSame($path, $csv->getIterator()->getRealPath()); } public function testCreateFromPathWithSplFileInfo() { - $path = __DIR__.'/foo.csv'; + $path = __DIR__.'/data/foo.csv'; $csv = Reader::createFromPath(new SplFileInfo($path)); $this->assertSame($path, $csv->getIterator()->getRealPath()); } public function testCreateFromPathWithPHPWrapper() { - $path = __DIR__.'/foo.csv'; + $path = __DIR__.'/data/foo.csv'; $csv = Reader::createFromPath('php://filter/read=string.toupper/resource='.$path); $this->assertFalse($csv->getIterator()->getRealPath()); } @@ -45,9 +45,9 @@ class FactoryTest extends AbstractTestCase /** * @expectedException InvalidArgumentException */ - public function testCreateFromPathWithUnStringableObject() + public function testCreateFromPathWithInvalidObject() { - Reader::createFromPath(new DateTime()); + Reader::createFromPath(new ArrayIterator([])); } public function testCreateFromString() @@ -67,7 +67,7 @@ class FactoryTest extends AbstractTestCase public function testCreateFromFileObjectWithSplFileObject() { - $path = __DIR__.'/foo.csv'; + $path = __DIR__.'/data/foo.csv'; $obj = new SplFileObject($path); $reader = Reader::createFromFileObject($obj); $this->assertInstanceof('League\Csv\Reader', $reader); |