Skip to content

Commit

Permalink
test(wploadersuite) suppress errors to work around older WC activatio…
Browse files Browse the repository at this point in the history
…n issue
  • Loading branch information
lucatume committed Dec 11, 2023
1 parent 070b3e9 commit 826e9d3
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions tests/wploadersuite/AjaxTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,15 @@ public function testAjaxCallbackWillFailIfNumberNotOnlyOnceIsInvalid(): void
{
$response = null;
try {
global $wpdb;
$wpdb->suppress_errors = true; // Due to a WooCommerce activation issue in older versions.
$this->_handleAjax('test_ajax_action');
} catch (\WPAjaxDieContinueException $exception) {
$response = json_decode($this->_last_response);
}

$wpdb->suppress_errors = false;

$this->assertNotNull($response);
$this->assertFalse($response->success);
$this->assertEquals('Number not only once is invalid', $response->data);
Expand Down

0 comments on commit 826e9d3

Please sign in to comment.