Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
migrate_source_csv
Manage
Activity
Members
Labels
Plan
Wiki
Custom issue tracker
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Model registry
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
project
migrate_source_csv
Commits
4c94aaa7
Commit
4c94aaa7
authored
7 years ago
by
Edys Meza
Committed by
Lucas Hedding
7 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Issue
#2954413
by edysmp, quietone: Add getter for file
parent
0919c4e9
Branches
Branches containing commit
Tags
8.x-1.7
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/Plugin/migrate/source/CSV.php
+10
-0
10 additions, 0 deletions
src/Plugin/migrate/source/CSV.php
tests/src/Unit/Plugin/migrate/source/CSVUnitTest.php
+18
-0
18 additions, 0 deletions
tests/src/Unit/Plugin/migrate/source/CSVUnitTest.php
with
28 additions
and
0 deletions
src/Plugin/migrate/source/CSV.php
+
10
−
0
View file @
4c94aaa7
...
...
@@ -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}
*/
...
...
This diff is collapsed.
Click to expand it.
tests/src/Unit/Plugin/migrate/source/CSVUnitTest.php
+
18
−
0
View file @
4c94aaa7
...
...
@@ -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.
*
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment