diff --git a/tests/test-ajax-requests.php b/tests/test-ajax-requests.php index f382c5a..7d5ae8b 100644 --- a/tests/test-ajax-requests.php +++ b/tests/test-ajax-requests.php @@ -42,7 +42,7 @@ public function test_logged_in_user_can_access() { } catch ( WPAjaxDieContinueException $exception ) { // We expect this exception to be thrown. } -var_dump( $this->_last_response ); + // Assert that the response contains the post title. $this->assertSame( 'Sample Post Title', $this->_last_response ); @@ -96,11 +96,11 @@ public function test_invalid_nonce_for_logged_in_user() { // Make the request. try { $this->_handleAjax( 'wp-search-suggest' ); - } catch ( WPAjaxDieContinueException $exception ) { + } catch ( WPAjaxDieStopException $exception ) { // We expect this exception to be thrown. } // Assert that the response contains an error message. - $this->expectExceptionMessage( '-1' ); + $this->assertSame( '-1', $this->_last_response ); } }