diff --git a/tests/test-ajax-requests.php b/tests/test-ajax-requests.php index 7d5ae8b..ceb0722 100644 --- a/tests/test-ajax-requests.php +++ b/tests/test-ajax-requests.php @@ -90,7 +90,7 @@ public function test_invalid_nonce_for_logged_in_user() { $this->_setRole( 'subscriber' ); // Set up the request with the invalid nonce. - $_GET['q'] = 'your_search_query'; + $_GET['q'] = 'Title'; $_GET['_wpnonce'] = 'invalid_nonce'; // Make the request. @@ -101,6 +101,7 @@ public function test_invalid_nonce_for_logged_in_user() { } // Assert that the response contains an error message. - $this->assertSame( '-1', $this->_last_response ); + $this->expectException( 'WPAjaxDieStopException' ); + $this->expectExceptionMessage( '-1' ); } }