From 44b7ee5ec4cc9cfcb41305ab8f7a36fa66873a3c Mon Sep 17 00:00:00 2001 From: Paul Bearne Date: Thu, 4 Jun 2026 16:27:37 -0400 Subject: [PATCH 1/4] Add unit tests for AJAX handlers: `wp_ajax_get_revision_diffs` and `wp_ajax_send_link_to_editor`. --- .../ajax-actions/getRevisionDiffs.php | 201 ++++++++++++++++++ .../ajax-actions/sendLinkToEditor.php | 167 +++++++++++++++ 2 files changed, 368 insertions(+) create mode 100644 tests/phpunit/tests/admin/includes/ajax-actions/getRevisionDiffs.php create mode 100644 tests/phpunit/tests/admin/includes/ajax-actions/sendLinkToEditor.php diff --git a/tests/phpunit/tests/admin/includes/ajax-actions/getRevisionDiffs.php b/tests/phpunit/tests/admin/includes/ajax-actions/getRevisionDiffs.php new file mode 100644 index 0000000000000..72063d9fca886 --- /dev/null +++ b/tests/phpunit/tests/admin/includes/ajax-actions/getRevisionDiffs.php @@ -0,0 +1,201 @@ +user->create( array( 'role' => 'administrator' ) ); + + self::$post_id = $factory->post->create( + array( + 'post_title' => 'Initial Title', + 'post_content' => 'Initial Content', + ) + ); + + // Create revisions. + wp_update_post( + array( + 'ID' => self::$post_id, + 'post_title' => 'Updated Title 1', + 'post_content' => 'Updated Content 1', + ) + ); + + wp_update_post( + array( + 'ID' => self::$post_id, + 'post_title' => 'Updated Title 2', + 'post_content' => 'Updated Content 2', + ) + ); + + self::$revision_ids = array_values( + wp_get_post_revisions( + self::$post_id, + array( + 'fields' => 'ids', + ) + ) + ); + } + + public function set_up(): void { + parent::set_up(); + add_action( 'wp_ajax_get-revision-diffs', 'wp_ajax_get_revision_diffs', 1 ); + + // Hook into wp_die to prevent execution from stopping. + add_filter( 'wp_die_ajax_handler', array( $this, 'getDieHandler' ) ); + } + + public function tear_down(): void { + remove_filter( 'wp_die_ajax_handler', array( $this, 'getDieHandler' ) ); + parent::tear_down(); + } + + /** + * Returns our custom die handler. + * + * @return callable + */ + public function getDieHandler() { + return array( $this, 'dieHandler' ); + } + + /** + * Custom die handler that throws an exception. + * + * @param string|WP_Error $message + */ + public function dieHandler( $message ) { + error_log( 'Die message: ' . print_r( $message, true ) ); + $this->_last_response .= ob_get_clean(); + + if ( '' === $this->_last_response ) { + if ( is_scalar( $message ) ) { + $this->_last_response = (string) $message; + } else { + $this->_last_response = '0'; + } + } + + if ( '-1' === $this->_last_response || ( is_int( $message ) && -1 === $message ) ) { + throw new WPAjaxDieStopException( $this->_last_response ); + } + + throw new WPAjaxDieContinueException( $this->_last_response ); + } + + /** + * Tests success for wp_ajax_get_revision_diffs(). + * + * @ticket 65252 + */ + public function test_get_revision_diffs_success(): void { + wp_set_current_user( self::$admin_id ); + + $compare_key = self::$revision_ids[1] . ':' . self::$revision_ids[0]; + + $_REQUEST['post_id'] = self::$post_id; + $_REQUEST['compare'] = array( $compare_key ); + + try { + $this->_handleAjax( 'get-revision-diffs' ); + } catch ( WPAjaxDieContinueException $e ) { + } + + $response = json_decode( $this->_last_response, true ); + if ( ! $response['success'] ) { + error_log( 'Response: ' . $this->_last_response ); + } + + $this->assertTrue( $response['success'], 'AJAX response should be successful' ); + $this->assertCount( 1, $response['data'] ); + $this->assertEquals( $compare_key, $response['data'][0]['id'] ); + $this->assertArrayHasKey( 'fields', $response['data'][0] ); + } + + /** + * Tests failure with non-existent post for wp_ajax_get_revision_diffs(). + * + * @ticket 65252 + */ + public function test_get_revision_diffs_invalid_post(): void { + wp_set_current_user( self::$admin_id ); + + $_REQUEST['post_id'] = 999999; + $_REQUEST['compare'] = array( '1:2' ); + + try { + $this->_handleAjax( 'get-revision-diffs' ); + } catch ( WPAjaxDieContinueException $e ) { + } + + $response = json_decode( $this->_last_response, true ); + + $this->assertFalse( $response['success'], 'AJAX response should be unsuccessful' ); + } + + /** + * Tests failure with insufficient permissions for wp_ajax_get_revision_diffs(). + * + * @ticket 65252 + */ + public function test_get_revision_diffs_insufficient_permissions(): void { + $subscriber_id = self::factory()->user->create( array( 'role' => 'subscriber' ) ); + wp_set_current_user( $subscriber_id ); + + $_REQUEST['post_id'] = self::$post_id; + $_REQUEST['compare'] = array( self::$revision_ids[1] . ':' . self::$revision_ids[0] ); + + try { + $this->_handleAjax( 'get-revision-diffs' ); + } catch ( WPAjaxDieContinueException $e ) { + } + + $response = json_decode( $this->_last_response, true ); + + $this->assertFalse( $response['success'], 'AJAX response should be unsuccessful' ); + } +} diff --git a/tests/phpunit/tests/admin/includes/ajax-actions/sendLinkToEditor.php b/tests/phpunit/tests/admin/includes/ajax-actions/sendLinkToEditor.php new file mode 100644 index 0000000000000..b0f1f7516fe89 --- /dev/null +++ b/tests/phpunit/tests/admin/includes/ajax-actions/sendLinkToEditor.php @@ -0,0 +1,167 @@ +user->create( array( 'role' => 'administrator' ) ); + } + + public function set_up(): void { + parent::set_up(); + add_action( 'wp_ajax_send-link-to-editor', 'wp_ajax_send_link_to_editor', 1 ); + + // Hook into wp_die to prevent execution from stopping. + add_filter( 'wp_die_ajax_handler', array( $this, 'getDieHandler' ) ); + } + + public function tear_down(): void { + remove_filter( 'wp_die_ajax_handler', array( $this, 'getDieHandler' ) ); + parent::tear_down(); + } + + /** + * Returns our custom die handler. + * + * @return callable + */ + public function getDieHandler() { + return array( $this, 'dieHandler' ); + } + + /** + * Custom die handler that throws an exception. + * + * @param string|WP_Error $message + */ + public function dieHandler( $message ) { + $this->_last_response .= ob_get_clean(); + + if ( '' === $this->_last_response ) { + if ( is_scalar( $message ) ) { + $this->_last_response = (string) $message; + } else { + $this->_last_response = '0'; + } + } + + if ( '-1' === $this->_last_response || ( is_int( $message ) && -1 === $message ) ) { + throw new WPAjaxDieStopException( $this->_last_response ); + } + + throw new WPAjaxDieContinueException( $this->_last_response ); + } + + /** + * Tests success for wp_ajax_send_link_to_editor() with a regular link. + * + * @ticket 65252 + */ + public function test_send_link_to_editor_regular_link_success(): void { + wp_set_current_user( self::$admin_id ); + + $_POST['nonce'] = wp_create_nonce( 'media-send-to-editor' ); + $_POST['src'] = 'http://example.com/test.txt'; + $_POST['link_text'] = 'Example Text'; + + try { + $this->_handleAjax( 'send-link-to-editor' ); + } catch ( WPAjaxDieContinueException $e ) { + } + + $response = json_decode( $this->_last_response, true ); + + $this->assertTrue( $response['success'], 'AJAX response should be successful' ); + $this->assertStringContainsString( 'href="http://example.com/test.txt"', $response['data'] ); + $this->assertStringContainsString( 'Example Text', $response['data'] ); + } + + /** + * Tests success for wp_ajax_send_link_to_editor() with an embeddable link. + * + * @ticket 65252 + */ + public function test_send_link_to_editor_embed_link_success(): void { + wp_set_current_user( self::$admin_id ); + + // YouTube is a default oEmbed provider. + $_POST['nonce'] = wp_create_nonce( 'media-send-to-editor' ); + $_POST['src'] = 'https://www.youtube.com/watch?v=dQw4w9WgXcQ'; + $_POST['link_text'] = 'Rickroll'; + + try { + $this->_handleAjax( 'send-link-to-editor' ); + } catch ( WPAjaxDieContinueException $e ) { + } + + $response = json_decode( $this->_last_response, true ); + + $this->assertTrue( $response['success'], 'AJAX response should be successful' ); + $this->assertStringContainsString( '[embed]', $response['data'] ); + $this->assertStringContainsString( 'https://www.youtube.com/watch?v=dQw4w9WgXcQ', $response['data'] ); + } + + /** + * Tests failure with invalid nonce for wp_ajax_send_link_to_editor(). + * + * @ticket 65252 + */ + public function test_send_link_to_editor_invalid_nonce(): void { + wp_set_current_user( self::$admin_id ); + + $_POST['nonce'] = 'invalid-nonce'; + + $this->expectException( WPAjaxDieStopException::class ); + $this->expectExceptionMessage( '-1' ); + + $this->_handleAjax( 'send-link-to-editor' ); + } + + /** + * Tests failure with missing source for wp_ajax_send_link_to_editor(). + * + * @ticket 65252 + */ + public function test_send_link_to_editor_missing_src(): void { + wp_set_current_user( self::$admin_id ); + + $_POST['nonce'] = wp_create_nonce( 'media-send-to-editor' ); + $_POST['src'] = ''; + + try { + $this->_handleAjax( 'send-link-to-editor' ); + } catch ( WPAjaxDieContinueException $e ) { + } + + $response = json_decode( $this->_last_response, true ); + + $this->assertFalse( $response['success'], 'AJAX response should be unsuccessful' ); + } +} From 723971ec73877de2a49e9db7ca6d315fcba197d2 Mon Sep 17 00:00:00 2001 From: Paul Bearne Date: Thu, 4 Jun 2026 16:57:08 -0400 Subject: [PATCH 2/4] Add unit tests for AJAX handler: `wp_ajax_save_user_color_scheme` --- .../ajax-actions/saveUserColorScheme.php | 171 ++++++++++++++++++ 1 file changed, 171 insertions(+) create mode 100644 tests/phpunit/tests/admin/includes/ajax-actions/saveUserColorScheme.php diff --git a/tests/phpunit/tests/admin/includes/ajax-actions/saveUserColorScheme.php b/tests/phpunit/tests/admin/includes/ajax-actions/saveUserColorScheme.php new file mode 100644 index 0000000000000..cfcbe149e29e4 --- /dev/null +++ b/tests/phpunit/tests/admin/includes/ajax-actions/saveUserColorScheme.php @@ -0,0 +1,171 @@ +user->create( array( 'role' => 'administrator' ) ); + } + + public function set_up(): void { + parent::set_up(); + add_action( 'wp_ajax_save-color-scheme', 'wp_ajax_save_user_color_scheme', 1 ); + + // Hook into wp_die to prevent execution from stopping. + add_filter( 'wp_die_ajax_handler', array( $this, 'getDieHandler' ) ); + } + + public function tear_down(): void { + remove_filter( 'wp_die_ajax_handler', array( $this, 'getDieHandler' ) ); + parent::tear_down(); + } + + /** + * Returns our custom die handler. + * + * @return callable + */ + public function getDieHandler() { + return array( $this, 'dieHandler' ); + } + + /** + * Custom die handler that throws an exception. + * + * @param string|WP_Error $message + */ + public function dieHandler( $message ) { + $this->_last_response .= ob_get_clean(); + + if ( '' === $this->_last_response ) { + if ( is_scalar( $message ) ) { + $this->_last_response = (string) $message; + } else { + $this->_last_response = '0'; + } + } + + if ( '-1' === $this->_last_response || ( is_int( $message ) && -1 === $message ) ) { + throw new WPAjaxDieStopException( $this->_last_response ); + } + + throw new WPAjaxDieContinueException( $this->_last_response ); + } + + /** + * Tests success for wp_ajax_save_user_color_scheme(). + * + * @ticket 65252 + * + * @dataProvider data_save_user_color_scheme_success + * + * @param string $color_scheme The color scheme to save. + */ + public function test_save_user_color_scheme_success( string $color_scheme ): void { + wp_set_current_user( self::$admin_id ); + + $_POST['nonce'] = wp_create_nonce( 'save-color-scheme' ); + $_POST['color_scheme'] = $color_scheme; + + // Set an initial color scheme to check if it changes correctly. + update_user_meta( self::$admin_id, 'admin_color', 'fresh' ); + + try { + $this->_handleAjax( 'save-color-scheme' ); + } catch ( WPAjaxDieContinueException $e ) { + } + + $response = json_decode( $this->_last_response, true ); + + $this->assertTrue( $response['success'], 'AJAX response should be successful' ); + $this->assertSame( 'admin-color-fresh', $response['data']['previousScheme'] ); + $this->assertSame( 'admin-color-' . $color_scheme, $response['data']['currentScheme'] ); + $this->assertSame( $color_scheme, get_user_meta( self::$admin_id, 'admin_color', true ) ); + } + + /** + * Data provider for test_save_user_color_scheme_success. + * + * @return array + */ + public function data_save_user_color_scheme_success(): array { + return array( + 'default scheme' => array( + 'color_scheme' => 'fresh', + ), + 'light scheme' => array( + 'color_scheme' => 'light', + ), + 'coffee scheme' => array( + 'color_scheme' => 'coffee', + ), + ); + } + + /** + * Tests failure for wp_ajax_save_user_color_scheme() with invalid color scheme. + * + * @ticket 65252 + */ + public function test_save_user_color_scheme_invalid_scheme(): void { + wp_set_current_user( self::$admin_id ); + + $_POST['nonce'] = wp_create_nonce( 'save-color-scheme' ); + $_POST['color_scheme'] = 'non-existent-scheme'; + + try { + $this->_handleAjax( 'save-color-scheme' ); + } catch ( WPAjaxDieContinueException $e ) { + } + + $response = json_decode( $this->_last_response, true ); + + $this->assertFalse( $response['success'], 'AJAX response should be unsuccessful for invalid color scheme' ); + } + + /** + * Tests failure for wp_ajax_save_user_color_scheme() with invalid nonce. + * + * @ticket 65252 + */ + public function test_save_user_color_scheme_invalid_nonce(): void { + wp_set_current_user( self::$admin_id ); + + $_POST['nonce'] = 'invalid-nonce'; + $_POST['color_scheme'] = 'fresh'; + + $this->expectException( WPAjaxDieStopException::class ); + $this->expectExceptionMessage( '-1' ); + + $this->_handleAjax( 'save-color-scheme' ); + } +} From a5b02589aaa48944c7b06f6c2fdfca4a17b9fab0 Mon Sep 17 00:00:00 2001 From: Paul Bearne Date: Thu, 4 Jun 2026 17:02:24 -0400 Subject: [PATCH 3/4] Delete tests/phpunit/tests/admin/includes/ajax-actions/getRevisionDiffs.php --- .../ajax-actions/getRevisionDiffs.php | 201 ------------------ 1 file changed, 201 deletions(-) delete mode 100644 tests/phpunit/tests/admin/includes/ajax-actions/getRevisionDiffs.php diff --git a/tests/phpunit/tests/admin/includes/ajax-actions/getRevisionDiffs.php b/tests/phpunit/tests/admin/includes/ajax-actions/getRevisionDiffs.php deleted file mode 100644 index 72063d9fca886..0000000000000 --- a/tests/phpunit/tests/admin/includes/ajax-actions/getRevisionDiffs.php +++ /dev/null @@ -1,201 +0,0 @@ -user->create( array( 'role' => 'administrator' ) ); - - self::$post_id = $factory->post->create( - array( - 'post_title' => 'Initial Title', - 'post_content' => 'Initial Content', - ) - ); - - // Create revisions. - wp_update_post( - array( - 'ID' => self::$post_id, - 'post_title' => 'Updated Title 1', - 'post_content' => 'Updated Content 1', - ) - ); - - wp_update_post( - array( - 'ID' => self::$post_id, - 'post_title' => 'Updated Title 2', - 'post_content' => 'Updated Content 2', - ) - ); - - self::$revision_ids = array_values( - wp_get_post_revisions( - self::$post_id, - array( - 'fields' => 'ids', - ) - ) - ); - } - - public function set_up(): void { - parent::set_up(); - add_action( 'wp_ajax_get-revision-diffs', 'wp_ajax_get_revision_diffs', 1 ); - - // Hook into wp_die to prevent execution from stopping. - add_filter( 'wp_die_ajax_handler', array( $this, 'getDieHandler' ) ); - } - - public function tear_down(): void { - remove_filter( 'wp_die_ajax_handler', array( $this, 'getDieHandler' ) ); - parent::tear_down(); - } - - /** - * Returns our custom die handler. - * - * @return callable - */ - public function getDieHandler() { - return array( $this, 'dieHandler' ); - } - - /** - * Custom die handler that throws an exception. - * - * @param string|WP_Error $message - */ - public function dieHandler( $message ) { - error_log( 'Die message: ' . print_r( $message, true ) ); - $this->_last_response .= ob_get_clean(); - - if ( '' === $this->_last_response ) { - if ( is_scalar( $message ) ) { - $this->_last_response = (string) $message; - } else { - $this->_last_response = '0'; - } - } - - if ( '-1' === $this->_last_response || ( is_int( $message ) && -1 === $message ) ) { - throw new WPAjaxDieStopException( $this->_last_response ); - } - - throw new WPAjaxDieContinueException( $this->_last_response ); - } - - /** - * Tests success for wp_ajax_get_revision_diffs(). - * - * @ticket 65252 - */ - public function test_get_revision_diffs_success(): void { - wp_set_current_user( self::$admin_id ); - - $compare_key = self::$revision_ids[1] . ':' . self::$revision_ids[0]; - - $_REQUEST['post_id'] = self::$post_id; - $_REQUEST['compare'] = array( $compare_key ); - - try { - $this->_handleAjax( 'get-revision-diffs' ); - } catch ( WPAjaxDieContinueException $e ) { - } - - $response = json_decode( $this->_last_response, true ); - if ( ! $response['success'] ) { - error_log( 'Response: ' . $this->_last_response ); - } - - $this->assertTrue( $response['success'], 'AJAX response should be successful' ); - $this->assertCount( 1, $response['data'] ); - $this->assertEquals( $compare_key, $response['data'][0]['id'] ); - $this->assertArrayHasKey( 'fields', $response['data'][0] ); - } - - /** - * Tests failure with non-existent post for wp_ajax_get_revision_diffs(). - * - * @ticket 65252 - */ - public function test_get_revision_diffs_invalid_post(): void { - wp_set_current_user( self::$admin_id ); - - $_REQUEST['post_id'] = 999999; - $_REQUEST['compare'] = array( '1:2' ); - - try { - $this->_handleAjax( 'get-revision-diffs' ); - } catch ( WPAjaxDieContinueException $e ) { - } - - $response = json_decode( $this->_last_response, true ); - - $this->assertFalse( $response['success'], 'AJAX response should be unsuccessful' ); - } - - /** - * Tests failure with insufficient permissions for wp_ajax_get_revision_diffs(). - * - * @ticket 65252 - */ - public function test_get_revision_diffs_insufficient_permissions(): void { - $subscriber_id = self::factory()->user->create( array( 'role' => 'subscriber' ) ); - wp_set_current_user( $subscriber_id ); - - $_REQUEST['post_id'] = self::$post_id; - $_REQUEST['compare'] = array( self::$revision_ids[1] . ':' . self::$revision_ids[0] ); - - try { - $this->_handleAjax( 'get-revision-diffs' ); - } catch ( WPAjaxDieContinueException $e ) { - } - - $response = json_decode( $this->_last_response, true ); - - $this->assertFalse( $response['success'], 'AJAX response should be unsuccessful' ); - } -} From 2248aaec0e82f5a36b793a9493cfe4282ceb290f Mon Sep 17 00:00:00 2001 From: Paul Bearne Date: Thu, 4 Jun 2026 17:02:39 -0400 Subject: [PATCH 4/4] Delete tests/phpunit/tests/admin/includes/ajax-actions/sendLinkToEditor.php --- .../ajax-actions/sendLinkToEditor.php | 167 ------------------ 1 file changed, 167 deletions(-) delete mode 100644 tests/phpunit/tests/admin/includes/ajax-actions/sendLinkToEditor.php diff --git a/tests/phpunit/tests/admin/includes/ajax-actions/sendLinkToEditor.php b/tests/phpunit/tests/admin/includes/ajax-actions/sendLinkToEditor.php deleted file mode 100644 index b0f1f7516fe89..0000000000000 --- a/tests/phpunit/tests/admin/includes/ajax-actions/sendLinkToEditor.php +++ /dev/null @@ -1,167 +0,0 @@ -user->create( array( 'role' => 'administrator' ) ); - } - - public function set_up(): void { - parent::set_up(); - add_action( 'wp_ajax_send-link-to-editor', 'wp_ajax_send_link_to_editor', 1 ); - - // Hook into wp_die to prevent execution from stopping. - add_filter( 'wp_die_ajax_handler', array( $this, 'getDieHandler' ) ); - } - - public function tear_down(): void { - remove_filter( 'wp_die_ajax_handler', array( $this, 'getDieHandler' ) ); - parent::tear_down(); - } - - /** - * Returns our custom die handler. - * - * @return callable - */ - public function getDieHandler() { - return array( $this, 'dieHandler' ); - } - - /** - * Custom die handler that throws an exception. - * - * @param string|WP_Error $message - */ - public function dieHandler( $message ) { - $this->_last_response .= ob_get_clean(); - - if ( '' === $this->_last_response ) { - if ( is_scalar( $message ) ) { - $this->_last_response = (string) $message; - } else { - $this->_last_response = '0'; - } - } - - if ( '-1' === $this->_last_response || ( is_int( $message ) && -1 === $message ) ) { - throw new WPAjaxDieStopException( $this->_last_response ); - } - - throw new WPAjaxDieContinueException( $this->_last_response ); - } - - /** - * Tests success for wp_ajax_send_link_to_editor() with a regular link. - * - * @ticket 65252 - */ - public function test_send_link_to_editor_regular_link_success(): void { - wp_set_current_user( self::$admin_id ); - - $_POST['nonce'] = wp_create_nonce( 'media-send-to-editor' ); - $_POST['src'] = 'http://example.com/test.txt'; - $_POST['link_text'] = 'Example Text'; - - try { - $this->_handleAjax( 'send-link-to-editor' ); - } catch ( WPAjaxDieContinueException $e ) { - } - - $response = json_decode( $this->_last_response, true ); - - $this->assertTrue( $response['success'], 'AJAX response should be successful' ); - $this->assertStringContainsString( 'href="http://example.com/test.txt"', $response['data'] ); - $this->assertStringContainsString( 'Example Text', $response['data'] ); - } - - /** - * Tests success for wp_ajax_send_link_to_editor() with an embeddable link. - * - * @ticket 65252 - */ - public function test_send_link_to_editor_embed_link_success(): void { - wp_set_current_user( self::$admin_id ); - - // YouTube is a default oEmbed provider. - $_POST['nonce'] = wp_create_nonce( 'media-send-to-editor' ); - $_POST['src'] = 'https://www.youtube.com/watch?v=dQw4w9WgXcQ'; - $_POST['link_text'] = 'Rickroll'; - - try { - $this->_handleAjax( 'send-link-to-editor' ); - } catch ( WPAjaxDieContinueException $e ) { - } - - $response = json_decode( $this->_last_response, true ); - - $this->assertTrue( $response['success'], 'AJAX response should be successful' ); - $this->assertStringContainsString( '[embed]', $response['data'] ); - $this->assertStringContainsString( 'https://www.youtube.com/watch?v=dQw4w9WgXcQ', $response['data'] ); - } - - /** - * Tests failure with invalid nonce for wp_ajax_send_link_to_editor(). - * - * @ticket 65252 - */ - public function test_send_link_to_editor_invalid_nonce(): void { - wp_set_current_user( self::$admin_id ); - - $_POST['nonce'] = 'invalid-nonce'; - - $this->expectException( WPAjaxDieStopException::class ); - $this->expectExceptionMessage( '-1' ); - - $this->_handleAjax( 'send-link-to-editor' ); - } - - /** - * Tests failure with missing source for wp_ajax_send_link_to_editor(). - * - * @ticket 65252 - */ - public function test_send_link_to_editor_missing_src(): void { - wp_set_current_user( self::$admin_id ); - - $_POST['nonce'] = wp_create_nonce( 'media-send-to-editor' ); - $_POST['src'] = ''; - - try { - $this->_handleAjax( 'send-link-to-editor' ); - } catch ( WPAjaxDieContinueException $e ) { - } - - $response = json_decode( $this->_last_response, true ); - - $this->assertFalse( $response['success'], 'AJAX response should be unsuccessful' ); - } -}