a8cteam51 / safety-net

Scrub options, deactivate denylisted plugins, and delete user data on development sites.
20 stars 1 forks source link

Add PHPUnit Testing #98

Open jessLundie opened 1 year ago

jessLundie commented 1 year ago

PR in progress

Goal: to add some PHPUnit tests to Safety Net to avoid accidental breaking changes. Related discussion in Slack

Done So Far

To Do

We need to figure out the best way to simulate testing data for this. Given this plugin mostly operates on the DB, we may need to do this.

I've been looking to WooCommerce Bookings as an example, since it has a fair amount of testing built in. Bookings uses WP_Mock and also possibly a Docker setup to create a local testing environment, then remove it when testing is over.

Then, obviously, write some tests.