I am writing a system at the moment, where a user can can select 1 item from 8 arrays (creating 8 options). They then have the option to print out there selections a PDF.
The PDF is generated using DOMPDF and that data is sent to via POST. I obviously need to test that each combination of options prints correctly (by my mind this means a hell of a lot of manual testing).
Is there anything I can do with a bash script to automate the testing the process? As the content of the arrays will never change would it possible to write a testing script of some kind I can fire through the browser of the terminal?
If the PDF-Files for one combination of options are always identical, I would do the following:
I would create a "Master-PDF" for each option-combination. Then I would create the PDF-Files on the local filesystem, convert them to images and subtract them from the images of the appropriate Master-PDF (You only need to create them once).
When the resulting image is blank (every pixel is pure black), they are identical, so the generated PDF looks the same as the master, if they are not, something differs from the master and therefore the test didn't pass.
In combination with PHPUnit you should have a possibility to automate the testing rather easy.