tOOlmaRR / web-slideshow

a web application to display custom slideshows in a browser for locally-stored photos
0 stars 0 forks source link

Create Unit Tests for PHP Slideshow Control #10

Closed tOOlmaRR closed 4 years ago

tOOlmaRR commented 4 years ago

Actual: 3h 45m + 4h 45m + 7h 45m + 4h 30m so far

Create unit tests for the Slideshow Control (PHP). Ensure reasonable code coverage is attained and create any tasks needed to correct any issues found during testing

tOOlmaRR commented 4 years ago

also spent a bunch of trying hooking up unit testing to my CI via GitHub actions - should have tasked this out separately!

tOOlmaRR commented 4 years ago

spent sooooooooooooo much time that I've decided to cut my losses and create tasks to complete other bits and pieces.

However I did accomplish a few big items here:

  1. Converted the old PHP Control file into a working class which contains all of the functions that were previously 'global' functions
  2. Updated the web app to use this new class instead of global functions made available via the previously included PHP file
  3. Wrote 11 unit tests with 15 assertions and confirmed that they all pass
  4. Added unit testing to my GitHub workflow and confirmed that the tests run with each commit
  5. Massaged unit tests to run and pass in the cloud on a Linux machine (fixed a case sensitivity issue that cost me 2-3 hours)
  6. Determined how to generate code coverage and test execution reports that SonarCloud appears to want (but cannot get SonarCloud to recognize the reports committed to my repo)
  7. Created a Trait to define re-usable helper functions for unit tests including creation and deletion of test folders and files