Typically, the idea with unit testing is that if you make changes, you can simply run a simple series of tests so as not to disrupt existing functions. Thus, you will need to consider the typical data you expect, as well as border / bound cases, which may include quotation marks (to make sure they are escaped properly), SQL injection attacks (same thing), blank lines , strings of different encoding, NULL, boolean true , etc. Each test should verify that, given the data you entered, you get the expected result (in this case (respectively): inserted row, inserted row with escaped row, inserted blank row, changed or selected another encoding, and then inserted , the error is selected to NULL, the string "true" is inserted, etc.
I did not use the test environment after a few years, but I remember that I have good results with PHPUnit.
source share