-
-
Notifications
You must be signed in to change notification settings - Fork 336
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #358 from on2/master
Fatal error with ltrim() when using the EmptyEscapeParser
- Loading branch information
Showing
2 changed files
with
23 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -124,6 +124,25 @@ public function testPreserveEmptyLines() | |
} | ||
} | ||
|
||
/** | ||
* @covers ::parse | ||
* @covers ::extractRecord | ||
* @covers ::extractFieldContent | ||
* @covers ::extractEnclosedFieldContent | ||
*/ | ||
public function testReadingOnlyStream() | ||
{ | ||
$expected = [ | ||
['john', 'doe', '[email protected]'], | ||
[null], | ||
]; | ||
|
||
$stream = Stream::createFromPath(__DIR__.'/../data/foo_readonly.csv'); | ||
foreach (EmptyEscapeParser::parse($stream) as $offset => $record) { | ||
self::assertSame($expected[$offset], $record); | ||
} | ||
} | ||
|
||
/** | ||
* @covers ::parse | ||
* @covers ::extractRecord | ||
|