From d4fc97446588e907e2ffe64c4ca8429e09dc9b0c Mon Sep 17 00:00:00 2001 From: Konstantin Obenland Date: Sun, 12 Nov 2023 16:08:47 -0600 Subject: [PATCH] nonce --- tests/test-ajax-requests.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) 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' ); } }