MarcusBarnes / mik

The Move to Islandora Kit is an extensible PHP command-line tool for converting source content and metadata into packages suitable for importing into Islandora (or other digital repository and preservations systems).
GNU General Public License v3.0
34 stars 11 forks source link

Work on #388. #390

Closed mjordan closed 7 years ago

mjordan commented 7 years ago

Github issue: (#388)

What does this Pull Request do?

Adds support for commenting out rows in CSV input files.

What's new?

A check within the src/fetchers/Csv.php fetcher to filter out any rows that have a # at the beginning of the column configured to be the record_key. This filtering happens before fetchermanipulators are applied.

How should this be tested?

This PR can be tested using the proposed "testable" workflow described in #384. The following tests pass on my local copy:

  1. In the master branch, run the PHPUnit tests: phpunit --exclude-group inputvalidators --bootstrap vendor/autoload.php tests. You should get 46 tests, 66 assertions.
  2. Check out the issue-388 branch and rerun the tests. You should get the same results.

This test covers the changed code because the testGetNumRecs() test within the CsVFetcherTest.php class continues to pass.

We will need to document how to comment out rows in all of the CSV toolchain wiki pages.

MarcusBarnes commented 7 years ago

Thank you @mjordan Tests resulting int the expected output.

mjordan commented 7 years ago

Thanks, I'll update the various CSV toolchain wiki pages describing this new feature.