#261 adds an early return in cleanup() for when the presence table doesn't exist, but doesn't add a test for it — codecov shows 0% patch coverage on those 3 lines as a result.
#256 already established the pattern for simulating this: add_filter('option_wp_presence_db_version', '__return_zero'), then assert on WP_CLI::messages(...). Something like:
public function test_cleanup_reports_zero_without_a_table() {
add_filter( 'option_wp_presence_db_version', '__return_zero' );
$this->command->cleanup( array(), array( 'yes' => true ) );
$this->assertSame( array( '0 entries deleted.' ), WP_CLI::messages( 'success' ) );
$this->assertSame( array(), WP_CLI::messages( 'confirm' ) );
}
Follow-up from #261.
#261 adds an early return in
cleanup()for when the presence table doesn't exist, but doesn't add a test for it — codecov shows 0% patch coverage on those 3 lines as a result.#256 already established the pattern for simulating this:
add_filter('option_wp_presence_db_version', '__return_zero'), then assert onWP_CLI::messages(...). Something like:Follow-up from #261.