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

Issue 495: Make extensions of page image files configurable in CSV Book and Newspaper toolchains #496

Closed mjordan closed 5 years ago

mjordan commented 5 years ago

Github issue: #495

What does this Pull Request do?

Makes extensions of page image files configurable in CSV Book and Newspaper toolchains.

What's new?

In the CsvBooks.php and CsvNewspapers.php filegetter classes, replaced the hard-coded $allowed_file_extensions_for_OBJ property with a configuration option. The default values (if the option is not present in the .ini file) is the same as previously, to prevent backward breakage.

How should this be tested?

This is a 'testable' change. I have included to new test classes, tests/filegetters/CsvBooksTest.php and tests/filegetters/CsvNewspapersTest.php. In the master branch, running ./vendor/bin/phpunit results in:

OK, but incomplete, skipped, or risky tests!
Tests: 58, Assertions: 84, Skipped: 2.

In the issue-495 branch, running PHPUnit results in, showing two new tests and four new assertions:

OK, but incomplete, skipped, or risky tests!
Tests: 60, Assertions: 88, Skipped: 2.

In all new tests, I am testing for both the default value of $allowed_file_extensions_for_OBJ and a configured value.

Additional Notes

FILE_GETTER
allowed_file_extensions_for_OBJ[] = jpg
allowed_file_extensions_for_OBJ[] = tif

Interested parties

@MarcusBarnes @bondjimbond

mjordan commented 5 years ago

@MarcusBarnes @bondjimbond I have not included test configuration and data for this PR since it is completely testable with PHPUnit. Is this sufficient to merge, or do you want test data you can smoketest with?

bondjimbond commented 5 years ago

If you think PHPUnit is sufficient for testing, I'm happy with it.

mjordan commented 5 years ago

@MarcusBarnes do you have an opinion on this?

MarcusBarnes commented 5 years ago

@mjordan I've looked over the code. Since the change still provides the previous default values to prevent backward breakage and there are tests, I'm OK with merging.

MarcusBarnes commented 5 years ago

I'm happy to push the happy green "Merge pull request" button. Thumbs up, thumbs down?

mjordan commented 5 years ago

Thank you both!