diff options
author | Ignace Nyamagana Butera <nyamsprod@gmail.com> | 2014-08-07 08:47:02 +0200 |
---|---|---|
committer | Ignace Nyamagana Butera <nyamsprod@gmail.com> | 2014-08-07 08:47:02 +0200 |
commit | 4b6eb4a400de159fefa84aa8c5cae7ae06b7d7da (patch) | |
tree | a7ae963e1922ce23570b0efc0f3c898f03489186 /test | |
parent | 4d2ca343d8006cbbe1e53785100d2f41fb07a029 (diff) | |
download | csv-4b6eb4a400de159fefa84aa8c5cae7ae06b7d7da.zip csv-4b6eb4a400de159fefa84aa8c5cae7ae06b7d7da.tar.gz csv-4b6eb4a400de159fefa84aa8c5cae7ae06b7d7da.tar.bz2 |
update docblock info
Diffstat (limited to 'test')
-rw-r--r-- | test/CsvTest.php | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/test/CsvTest.php b/test/CsvTest.php index 7a17eca..4477105 100644 --- a/test/CsvTest.php +++ b/test/CsvTest.php @@ -34,6 +34,11 @@ class CsvTest extends PHPUnit_Framework_TestCase $this->csv = new Reader($csv); } + public function tearDown() + { + $this->csv = null; + } + public function testConstructorWithFilePath() { $path = __DIR__.'/foo.csv'; @@ -74,6 +79,22 @@ class CsvTest extends PHPUnit_Framework_TestCase new Reader(['/usr/bin/foo.csv']); } + public function testCreateFromPath() + { + $path = __DIR__.'/foo.csv'; + + $csv = Reader::createFromPath(new SplFileInfo($path)); + $this->assertSame($path, $csv->getIterator()->getRealPath()); + } + + /** + * @expectedException InvalidArgumentException + */ + public function testFailedCreateFromPath() + { + Reader::createFromPath(new SplTempFileObject); + } + public function testCreateFromString() { $expected = "john,doe,john.doe@example.com".PHP_EOL |