Skip to content

Improve Coverage for Gnumeric #1517

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 7 commits into from
Jun 19, 2020
Merged

Improve Coverage for Gnumeric #1517

merged 7 commits into from
Jun 19, 2020

Conversation

oleibman
Copy link
Collaborator

@oleibman oleibman commented Jun 7, 2020

This is:

- [x] a bugfix
- [ ] a new feature

Checklist:

Why this change is needed?

My goal was to use PhpSpreadsheet to load the test file,
save it as Xlsx, and visually compare the two, then add a test
loaded with assertions. Results were generally pretty good,
but there were no tests with assertions. I added a few cells
to exercise some previously uncovered code. Code was extensively
refactored; logic changes are noted below.

Code allowed for specifying document properties in an old format.
I considered removing that, but I found the original spec at
http://www.jfree.org/jworkbook/download/gnumeric-xml.pdf
This allowed me to create an old file, which was not handled
correctly because of namespace differences. The code was corrected
to allow for this difference.

Added support for textRotation.

Mapping of fill types was not correct.

Resync with base project
I believe that both BaseReader and Gnumeric Reader are now 100% covered.

My goal was to use PhpSpreadsheet to load the test file,
save it as Xlsx, and visually compare the two, then add a test
loaded with assertions. Results were generally pretty good,
but there were no tests with assertions. I added a few cells
to exercise some previously uncovered code. Code was extensively
refactored; logic changes are noted below.

Code allowed for specifying document properties in an old format.
I considered removing that, but I found the original spec at
http://www.jfree.org/jworkbook/download/gnumeric-xml.pdf
This allowed me to create an old file, which was not handled
correctly because of namespace differences. The code was corrected
to allow for this difference.

Added support for textRotation.

Mapping of fill types was not correct.
One assertion failed under PHP7.2. Apparently there was some change in
the handling of SimpleXMLElement between 7.2 and 7.3. Casting to string
before use eliminates the problem.
All minor, solved (hopefully) mostly by casts.
@oleibman oleibman mentioned this pull request Jun 19, 2020
5 tasks
@MarkBaker
Copy link
Member

MarkBaker commented Jun 19, 2020

It is great to have better coverage for the different features of the various spreadsheet formats that are available; and code coverage without assertions to verify the results isn't good. Thank you

@MarkBaker MarkBaker merged commit 73379cd into PHPOffice:master Jun 19, 2020
@oleibman oleibman deleted the readgnu branch November 2, 2020 01:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants