Skip to content

Commit

Permalink
Add tests for clear_product_statuses_cache_and_issues
Browse files Browse the repository at this point in the history
  • Loading branch information
jorgemd24 committed Mar 5, 2024
1 parent 6848100 commit f185a48
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions tests/Unit/MerchantCenter/MerchantStatusesTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -835,6 +835,18 @@ public function test_update_product_with_multiple_variables_and_multiple_batches
);
}

protected function test_clear_product_statuses_cache_and_issues() {
$this->transients->expects( $this->exactly( 1 ) )
->method( 'delete' )
->with(
TransientsInterface::MC_STATUSES
);

$this->merchant_issue_table->expects( $this->once() )->method( 'delete_stale' )->with( $this->merchant_statuses->get_cache_created_time() );
$this->options->expects( $this->once() )->method( 'delete' )->with( OptionsInterface::PRODUCT_STATUSES_COUNT_INTERMEDIATE_DATA );
$this->merchant_statuses->clear_product_statuses_cache_and_issues();
}

protected function get_product_status_item( $wc_product_id ): ProductStatus {
$product_status = new ProductStatus();
$product_status->setProductId( $this->get_mc_id( $wc_product_id ) );
Expand Down

0 comments on commit f185a48

Please sign in to comment.