Skip to content

Commit

Permalink
nonce
Browse files Browse the repository at this point in the history
  • Loading branch information
obenland committed Nov 12, 2023
1 parent 0e7fe6a commit d4fc974
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions tests/test-ajax-requests.php
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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' );
}
}

0 comments on commit d4fc974

Please sign in to comment.