test the reader with the writer #2745
Merged
Add this suggestion to a batch that can be applied as a single commit. This suggestion is invalid because no changes were made to the code. Suggestions cannot be applied while the pull request is closed. Suggestions cannot be applied while viewing a subset of changes. Only one suggestion per line can be applied in a batch. Add this suggestion to a batch that can be applied as a single commit. Applying suggestions on deleted lines is not supported. You must change the existing code in this line in order to create a valid suggestion. Outdated suggestions cannot be applied. This suggestion has been applied or marked resolved. Suggestions cannot be applied from pending reviews. Suggestions cannot be applied on multi-line comments. Suggestions cannot be applied while the pull request is queued to merge. Suggestion cannot be applied right now. Please check back later.
Description
I think that currently, there are only few good tests for the reader. (see for e.g. #2700 where the reader and writer where modified, but only the writer is actually covered by a test)
Creating and adding artifacts (docx and odt) is not ideal, as they are hard to verify and will contain random other artifacts.
By dynamically creating the test-file using the writer and reading it back in with the reader, we can simply test the reader against the writer.
In general, a WYSWYG word processor is assumed to read and save files without loosing anything. For a project like PHPOffice, the focus is stronger on the writer then the reader. With this setup, it is a lot easier to work on the reader, as a test driven development purely in PHP gets enabled - the need to use a word processor for verification gets significantly reduced.
There is also simply charm in self testing, as a simple to read test makes a literal "end to end" test, covering a lot of complex code with a few lines of simple code.
Fixes # (issue)
Checklist:
This are literal test. They do not effect the production code. So the checklist does not directly apply.