Skip to content

Commit

Permalink
Update CsvWriter readme.
Browse files Browse the repository at this point in the history
Remove useless "use" statements.
Reformat Tests

Signed-off-by: Benoît Burnichon <bburnichon@gmail.com>
  • Loading branch information
bburnichon committed Jul 12, 2014
1 parent 141e36f commit b91c2b6
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 12 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -376,8 +376,8 @@ Writes CSV files:
```php
use Ddeboer\DataImport\Writer\CsvWriter;

$file = new \SplFileObject('output.csv', 'w');
$writer = new CsvWriter($file);
$writer = new CsvWriter();
$writer->setStream(fopen('output.csv', 'w'));

// Write column headers:
$writer->writeItem(array('first', 'last'));
Expand Down
13 changes: 5 additions & 8 deletions tests/Ddeboer/DataImport/Tests/Writer/CsvWriterTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,18 +12,15 @@ public function testWriteItem()

$writer->writeItem(array('first', 'last'));

$writer->writeItem(
array(
$writer
->writeItem(array(
'first' => 'James',
'last' => 'Bond'
)
)->writeItem(
array(
))
->writeItem(array(
'first' => '',
'last' => 'Dr. No'
)
);

));
$this->assertContentsEquals(
"first;last\nJames;Bond\n;\"Dr. No\"\n",
$writer
Expand Down
2 changes: 0 additions & 2 deletions tests/Ddeboer/DataImport/Tests/Writer/StreamWriterTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@
namespace Ddeboer\DataImport\Tests\Writer;

use Ddeboer\DataImport\Writer\AbstractStreamWriter;
use PHPUnit_Framework_Assert;
use PHPUnit_Framework_Constraint_IsEqual;

abstract class StreamWriterTest extends \PHPUnit_Framework_TestCase
{
Expand Down

0 comments on commit b91c2b6

Please sign in to comment.