Skip to content

Commit

Permalink
Add another test to check is_active status method
Browse files Browse the repository at this point in the history
  • Loading branch information
tarecord committed Sep 29, 2023
1 parent 3c366ac commit 4eefa69
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions tests/wpunit/StatusTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -318,4 +318,18 @@ public function test_get_status_label( $option_value, $expected ): void {

$this->assertEquals( $label, $status->get_status() );
}

/**
* @dataProvider get_status_data_provider
*/
public function test_is_active( $option_value, $expected ): void {
$status = new Status();

update_option( $status->get_option_name(), $option_value );

$is_active = 1 === $expected ? true : false;

$this->assertIsBool( $status->is_active() );
$this->assertEquals( $is_active, $status->is_active() );
}
}

0 comments on commit 4eefa69

Please sign in to comment.