Skip to content
Snippets Groups Projects
Commit 4c94aaa7 authored by Edys Meza's avatar Edys Meza Committed by Lucas Hedding
Browse files

Issue #2954413 by edysmp, quietone: Add getter for file

parent 0919c4e9
Branches
Tags 8.x-1.7
No related merge requests found
......@@ -171,6 +171,16 @@ class CSV extends SourcePluginBase implements ConfigurablePluginInterface {
return $this->configuration;
}
/**
* Gets the file object.
*
* @return \SplFileObject
* The file object.
*/
public function getFile() {
return $this->file;
}
/**
* {@inheritdoc}
*/
......
......@@ -256,6 +256,24 @@ class CSVUnitTest extends CSVUnitBase {
$this->assertArrayEquals($expected, $csv->getIds());
}
/**
* Test the getFile return a valid file instance.
*
* @covers ::getFile
*/
public function testGetFile() {
$configuration = [
'path' => $this->happyPath,
'keys' => ['id'],
'header_row_count' => 1,
];
$csv = new CSV($configuration, $this->pluginId, $this->pluginDefinition, $this->migration);
$csv->initializeIterator();
$file = $csv->getFile();
$this->assertInstanceOf(\SplFileObject::class, $file);
}
/**
* Tests that fields have a machine name and description.
*
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment