Skip to content

Commit 5c6ece9

Browse files
committed
test(wploadersuite) suppress wpdb errors to work around older WC activation issues
1 parent 2b9b78e commit 5c6ece9

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

tests/wploadersuite/AjaxTest.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,15 @@ public function testAjaxCallbackWillFailIfNumberNotOnlyOnceIsInvalid(): void
2626
{
2727
$response = null;
2828
try {
29+
global $wpdb;
30+
$wpdb->suppress_errors = true; // Due to a WooCommerce activation issue in older versions.
2931
$this->_handleAjax('test_ajax_action');
3032
} catch (\WPAjaxDieContinueException) {
3133
$response = json_decode($this->_last_response);
3234
}
3335

36+
$wpdb->suppress_errors = false;
37+
3438
$this->assertNotNull($response);
3539
$this->assertFalse($response->success);
3640
$this->assertEquals('Number not only once is invalid', $response->data);

0 commit comments

Comments
 (0)