public function testCollectionExporter()
{
$author = new Author();
foreach (range(1, 10) as $i) {
$ret = $author->create(array('name' => 'Foo-' . $i, 'email' => 'foo@foo' . $i, 'identity' => 'foo' . $i, 'confirmed' => true));
$this->assertTrue($author->confirmed, 'is true');
$this->assertTrue($ret->success);
}
@mkdir('tests/tmp', 0755, true);
$fp = fopen('tests/tmp/authors.csv', 'w');
$exporter = new CSVExporter($fp);
$exporter->exportCollection(new AuthorCollection());
fclose($fp);
$authors = new AuthorCollection();
$authors->delete();
$fp = fopen('tests/tmp/authors.csv', 'r');
$importer = new CSVImporter(new Author());
$importer->importResource($fp);
fclose($fp);
}