diff --git a/tests/phpunit/tests/ajax/wpAjaxUpdatePlugin.php b/tests/phpunit/tests/ajax/wpAjaxUpdatePlugin.php index daae271ef6..08d65879ee 100644 --- a/tests/phpunit/tests/ajax/wpAjaxUpdatePlugin.php +++ b/tests/phpunit/tests/ajax/wpAjaxUpdatePlugin.php @@ -141,16 +141,18 @@ class Tests_Ajax_wpAjaxUpdatePlugin extends WP_Ajax_UnitTestCase { $_POST['plugin'] = 'hello.php'; $_POST['slug'] = 'hello-dolly'; + // Prevent wp_update_plugins() from running. + wp_installing( true ); + // Make the request. try { - // Prevent wp_update_plugins() from running. - wp_installing( true ); $this->_handleAjax( 'update-plugin' ); - wp_installing( false ); } catch ( WPAjaxDieContinueException $e ) { unset( $e ); } + wp_installing( false ); + // Get the response. $response = json_decode( $this->_last_response, true ); diff --git a/tests/phpunit/tests/ajax/wpAjaxUpdateTheme.php b/tests/phpunit/tests/ajax/wpAjaxUpdateTheme.php index 4e3f8a8e6a..c424d7f582 100644 --- a/tests/phpunit/tests/ajax/wpAjaxUpdateTheme.php +++ b/tests/phpunit/tests/ajax/wpAjaxUpdateTheme.php @@ -112,18 +112,18 @@ class Tests_Ajax_wpAjaxUpdateTheme extends WP_Ajax_UnitTestCase { $_POST['_ajax_nonce'] = wp_create_nonce( 'updates' ); $_POST['slug'] = 'twentyten'; + // Prevent wp_update_themes() from running. + wp_installing( true ); + // Make the request. try { - - // Prevent wp_update_themes() from running. - wp_installing( true ); $this->_handleAjax( 'update-theme' ); - wp_installing( false ); - } catch ( WPAjaxDieContinueException $e ) { unset( $e ); } + wp_installing( false ); + // Get the response. $response = json_decode( $this->_last_response, true );