setUp()
setUp()
Sets up the testing environment before each test.
Buoy alerts testing class.
We use PHPUnit's @ticket
annotation to refer to GitHub issues,
but still want to use WP_UnitTestCase
for its various factory
methods, so we subclass it and stub out the Trac-checking part. :)
test_schedule_and_unschedule_delete_old_alerts_hook_on_activation_and_deactivation()
Checks (de)activating the plugin (un)schedules "old" alerts for deletion.
It is important for Buoy alerts to be ephemeral in nature, not necessarily stored in a database for a long time. This test is used to make sure that merely activating the plugin is enough to tell the plugin to delete any incident data that was made 48 hours ago (or longer).
This test also checks for the inverse: that this scheduled job is automatically removed whenever the plugin is deactivated.
Note that this test does not ensure the alert data itself is deleted, only that the automatic job scheduler has the correct information.