Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions tests/test-cli-command.php
Original file line number Diff line number Diff line change
Expand Up @@ -302,6 +302,18 @@ public function test_cleanup_deletes_every_entry_regardless_of_age() {
$this->assertSame( array( '3 entries deleted.' ), WP_CLI::messages( 'success' ) );
}

/**
* @covers WP_Presence_CLI_Command::cleanup
*/
public function test_cleanup_reports_zero_without_a_table() {
add_filter( 'option_wp_presence_db_version', '__return_zero' );

$this->command->cleanup( array(), array() );

$this->assertSame( array( '0 entries deleted.' ), WP_CLI::messages( 'success' ) );
$this->assertSame( array(), WP_CLI::messages( 'confirm' ) );
}

/**
* @covers WP_Presence_CLI_Command::cleanup
*/
Expand Down
Loading