<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[51419] trunk/tests/phpunit: Tests: Reset `$current_screen` global between tests to avoid cross-test interdependencies.</title>
</head>
<body>
<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; }
#msg dl a { font-weight: bold}
#msg dl a:link { color:#fc3; }
#msg dl a:active { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { white-space: pre-line; overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta" style="font-size: 105%">
<dt style="float: left; width: 6em; font-weight: bold">Revision</dt> <dd><a style="font-weight: bold" href="https://core.trac.wordpress.org/changeset/51419">51419</a><script type="application/ld+json">{"@context":"http://schema.org","@type":"EmailMessage","description":"Review this Commit","action":{"@type":"ViewAction","url":"https://core.trac.wordpress.org/changeset/51419","name":"Review Commit"}}</script></dd>
<dt style="float: left; width: 6em; font-weight: bold">Author</dt> <dd>SergeyBiryukov</dd>
<dt style="float: left; width: 6em; font-weight: bold">Date</dt> <dd>2021-07-13 16:13:01 +0000 (Tue, 13 Jul 2021)</dd>
</dl>
<pre style='padding-left: 1em; margin: 2em 0; border-left: 2px solid #ccc; line-height: 1.25; font-size: 105%; font-family: sans-serif'>Tests: Reset `$current_screen` global between tests to avoid cross-test interdependencies.
This provides a consistent global starting state for tests that interact with admin screens.
Individual tests no longer need to invoke `set_current_screen( 'front' )` (or an alternative implementation) as a reset.
Follow-up to <a href="https://core.trac.wordpress.org/changeset/29251">[29251]</a>, <a href="https://core.trac.wordpress.org/changeset/29860">[29860]</a>, <a href="https://core.trac.wordpress.org/changeset/31046">[31046]</a>, <a href="https://core.trac.wordpress.org/changeset/36721">[36721]</a>, <a href="https://core.trac.wordpress.org/changeset/38678">[38678]</a>, <a href="https://core.trac.wordpress.org/changeset/48908">[48908]</a>, <a href="https://core.trac.wordpress.org/changeset/50433">[50433]</a>.
Props hellofromTonya, johnbillion.
Fixes <a href="https://core.trac.wordpress.org/ticket/53431">#53431</a>.</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunktestsphpunitincludesabstracttestcasephp">trunk/tests/phpunit/includes/abstract-testcase.php</a></li>
<li><a href="#trunktestsphpunittestsadminincludesPluginphp">trunk/tests/phpunit/tests/admin/includesPlugin.php</a></li>
<li><a href="#trunktestsphpunittestsadminincludesScreenphp">trunk/tests/phpunit/tests/admin/includesScreen.php</a></li>
<li><a href="#trunktestsphpunittestsadminincludesTemplatephp">trunk/tests/phpunit/tests/admin/includesTemplate.php</a></li>
<li><a href="#trunktestsphpunittestsadminbarphp">trunk/tests/phpunit/tests/adminbar.php</a></li>
<li><a href="#trunktestsphpunittestsdependenciesjqueryphp">trunk/tests/phpunit/tests/dependencies/jquery.php</a></li>
<li><a href="#trunktestsphpunittestsl10ngetUserLocalephp">trunk/tests/phpunit/tests/l10n/getUserLocale.php</a></li>
<li><a href="#trunktestsphpunittestsl10nloadTextdomainphp">trunk/tests/phpunit/tests/l10n/loadTextdomain.php</a></li>
<li><a href="#trunktestsphpunittestsl10nloadTextdomainJustInTimephp">trunk/tests/phpunit/tests/l10n/loadTextdomainJustInTime.php</a></li>
<li><a href="#trunktestsphpunittestsl10nwpLocaleSwitcherphp">trunk/tests/phpunit/tests/l10n/wpLocaleSwitcher.php</a></li>
<li><a href="#trunktestsphpunittestsmenuwpAjaxMenuQuickSearchphp">trunk/tests/phpunit/tests/menu/wpAjaxMenuQuickSearch.php</a></li>
<li><a href="#trunktestsphpunittestspostattachmentsphp">trunk/tests/phpunit/tests/post/attachments.php</a></li>
<li><a href="#trunktestsphpunittestsqueryconditionalsphp">trunk/tests/phpunit/tests/query/conditionals.php</a></li>
<li><a href="#trunktestsphpunittestsqueryisTermphp">trunk/tests/phpunit/tests/query/isTerm.php</a></li>
<li><a href="#trunktestsphpunittestsquerypostStatusphp">trunk/tests/phpunit/tests/query/postStatus.php</a></li>
<li><a href="#trunktestsphpunittestsrestapiphp">trunk/tests/phpunit/tests/rest-api.php</a></li>
<li><a href="#trunktestsphpunittestsurlphp">trunk/tests/phpunit/tests/url.php</a></li>
<li><a href="#trunktestsphpunittestsuserwpSendUserRequestphp">trunk/tests/phpunit/tests/user/wpSendUserRequest.php</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunktestsphpunitincludesabstracttestcasephp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/tests/phpunit/includes/abstract-testcase.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/includes/abstract-testcase.php 2021-07-13 15:38:12 UTC (rev 51418)
+++ trunk/tests/phpunit/includes/abstract-testcase.php 2021-07-13 16:13:01 UTC (rev 51419)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -157,7 +157,27 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $GLOBALS[ $global ] = null;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- // Reset $wp_sitemap global so that sitemap-related dynamic $wp->public_query_vars are added when the next test runs.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ /*
+ * Reset globals related to current screen to provide a consistent global starting state
+ * for tests that interact with admin screens. Replaces the need for individual tests
+ * to invoke `set_current_screen( 'front' )` (or an alternative implementation) as a reset.
+ *
+ * The globals are from `WP_Screen::set_current_screen()`.
+ *
+ * Why not invoke `set_current_screen( 'front' )`?
+ * Performance (faster test runs with less memory usage). How so? For each test,
+ * it saves creating an instance of WP_Screen, making two method calls,
+ * and firing of the `current_screen` action.
+ */
+ $current_screen_globals = array( 'current_screen', 'taxnow', 'typenow' );
+ foreach ( $current_screen_globals as $global ) {
+ $GLOBALS[ $global ] = null;
+ }
+
+ /*
+ * Reset $wp_sitemap global so that sitemap-related dynamic $wp->public_query_vars
+ * are added when the next test runs.
+ */
</ins><span class="cx" style="display: block; padding: 0 10px"> $GLOBALS['wp_sitemaps'] = null;
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $this->unregister_all_meta_keys();
</span></span></pre></div>
<a id="trunktestsphpunittestsadminincludesPluginphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/tests/phpunit/tests/admin/includesPlugin.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/admin/includesPlugin.php 2021-07-13 15:38:12 UTC (rev 51418)
+++ trunk/tests/phpunit/tests/admin/includesPlugin.php 2021-07-13 16:13:01 UTC (rev 51419)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -97,8 +97,6 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Clean up the temporary user.
</span><span class="cx" style="display: block; padding: 0 10px"> wp_delete_user( $admin_user );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- // Reset current screen.
- set_current_screen( 'front' );
</del><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Verify the menu was inserted at the expected position.
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertSame( 'custom-position', $submenu[ $parent ][ $expected_position ][2] );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -207,8 +205,6 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Clean up the temporary user.
</span><span class="cx" style="display: block; padding: 0 10px"> wp_delete_user( $admin_user );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- // Reset current screen.
- set_current_screen( 'front' );
</del><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> foreach ( $actual_positions as $test => $actual_position ) {
</span><span class="cx" style="display: block; padding: 0 10px"> // Verify the menu was inserted at the expected position.
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -292,8 +288,6 @@
</span><span class="cx" style="display: block; padding: 0 10px"> // Clean up the temporary user.
</span><span class="cx" style="display: block; padding: 0 10px"> wp_set_current_user( $current_user );
</span><span class="cx" style="display: block; padding: 0 10px"> wp_delete_user( $admin_user );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- // Reset current screen.
- set_current_screen( 'front' );
</del><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Verify the menu was inserted at the expected position.
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertSame( 'main_slug', $submenu['main_slug'][0][2] );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -325,8 +319,6 @@
</span><span class="cx" style="display: block; padding: 0 10px"> // Clean up the temporary user.
</span><span class="cx" style="display: block; padding: 0 10px"> wp_set_current_user( $current_user );
</span><span class="cx" style="display: block; padding: 0 10px"> wp_delete_user( $admin_user );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- // Reset current screen.
- set_current_screen( 'front' );
</del><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Verify the menu was inserted at the expected position.
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertSame( 'submenu_page_1', $submenu['main_slug'][1][2] );
</span></span></pre></div>
<a id="trunktestsphpunittestsadminincludesScreenphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/tests/phpunit/tests/admin/includesScreen.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/admin/includesScreen.php 2021-07-13 15:38:12 UTC (rev 51418)
+++ trunk/tests/phpunit/tests/admin/includesScreen.php 2021-07-13 16:13:01 UTC (rev 51419)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -155,15 +155,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> ),
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- function setUp() {
- parent::setUp();
- set_current_screen( 'front' );
- }
-
</del><span class="cx" style="display: block; padding: 0 10px"> function tearDown() {
</span><span class="cx" style="display: block; padding: 0 10px"> unset( $GLOBALS['wp_taxonomies']['old-or-new'] );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- unset( $GLOBALS['screen'] );
- unset( $GLOBALS['current_screen'] );
</del><span class="cx" style="display: block; padding: 0 10px"> parent::tearDown();
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -311,6 +304,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> 'callback' => false,
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ set_current_screen( 'edit.php' );
</ins><span class="cx" style="display: block; padding: 0 10px"> $screen = get_current_screen();
</span><span class="cx" style="display: block; padding: 0 10px"> $screen->add_help_tab( $tab_args );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertSame(
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -372,6 +366,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> // Don't include a priority.
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ set_current_screen( 'edit.php' );
</ins><span class="cx" style="display: block; padding: 0 10px"> $screen = get_current_screen();
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Add help tabs.
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -440,6 +435,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> 'option' => $option,
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ set_current_screen( 'edit.php' );
</ins><span class="cx" style="display: block; padding: 0 10px"> $screen = get_current_screen();
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $screen->add_option( $option, $option_args );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -456,8 +452,6 @@
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function test_in_admin() {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $screen = get_current_screen();
-
</del><span class="cx" style="display: block; padding: 0 10px"> set_current_screen( 'edit.php' );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertTrue( get_current_screen()->in_admin() );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertTrue( get_current_screen()->in_admin( 'site' ) );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -481,8 +475,6 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertFalse( get_current_screen()->in_admin( 'site' ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertFalse( get_current_screen()->in_admin( 'network' ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertFalse( get_current_screen()->in_admin( 'user' ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-
- $GLOBALS['current_screen'] = $screen;
</del><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span></span></pre></div>
<a id="trunktestsphpunittestsadminincludesTemplatephp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/tests/phpunit/tests/admin/includesTemplate.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/admin/includesTemplate.php 2021-07-13 15:38:12 UTC (rev 51418)
+++ trunk/tests/phpunit/tests/admin/includesTemplate.php 2021-07-13 16:13:01 UTC (rev 51419)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -234,8 +234,6 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // This doesn't actually get removed due to the invalid priority.
</span><span class="cx" style="display: block; padding: 0 10px"> remove_meta_box( 'dashboard2', 'dashboard', 'normal' );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-
- set_current_screen( 'front' );
</del><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span></span></pre></div>
<a id="trunktestsphpunittestsadminbarphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/tests/phpunit/tests/adminbar.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/adminbar.php 2021-07-13 15:38:12 UTC (rev 51418)
+++ trunk/tests/phpunit/tests/adminbar.php 2021-07-13 16:13:01 UTC (rev 51419)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -400,8 +400,6 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $wp_admin_bar = $this->get_standard_admin_bar();
</span><span class="cx" style="display: block; padding: 0 10px"> $node = $wp_admin_bar->get_node( 'archive' );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- set_current_screen( 'front' );
-
</del><span class="cx" style="display: block; padding: 0 10px"> $this->assertNull( $node );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -415,8 +413,6 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $wp_admin_bar = $this->get_standard_admin_bar();
</span><span class="cx" style="display: block; padding: 0 10px"> $node = $wp_admin_bar->get_node( 'archive' );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- set_current_screen( 'front' );
-
</del><span class="cx" style="display: block; padding: 0 10px"> $this->assertNotNull( $node );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -429,8 +425,6 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $wp_admin_bar = $this->get_standard_admin_bar();
</span><span class="cx" style="display: block; padding: 0 10px"> $node = $wp_admin_bar->get_node( 'archive' );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- set_current_screen( 'front' );
-
</del><span class="cx" style="display: block; padding: 0 10px"> $this->assertNull( $node );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -508,7 +502,6 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $wp_admin_bar = $this->get_standard_admin_bar();
</span><span class="cx" style="display: block; padding: 0 10px"> $node = $wp_admin_bar->get_node( 'archive' );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- set_current_screen( 'front' );
</del><span class="cx" style="display: block; padding: 0 10px"> unregister_post_type( 'foo-non-public' );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertNull( $node );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -532,7 +525,6 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $wp_admin_bar = $this->get_standard_admin_bar();
</span><span class="cx" style="display: block; padding: 0 10px"> $node = $wp_admin_bar->get_node( 'archive' );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- set_current_screen( 'front' );
</del><span class="cx" style="display: block; padding: 0 10px"> unregister_post_type( 'foo-non-public' );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertNull( $node );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -556,7 +548,6 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $wp_admin_bar = $this->get_standard_admin_bar();
</span><span class="cx" style="display: block; padding: 0 10px"> $node = $wp_admin_bar->get_node( 'archive' );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- set_current_screen( 'front' );
</del><span class="cx" style="display: block; padding: 0 10px"> unregister_post_type( 'foo-non-public' );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertNull( $node );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -679,7 +670,6 @@
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px"> $wp_customize->start_previewing_theme();
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- set_current_screen( 'front' );
</del><span class="cx" style="display: block; padding: 0 10px"> $wp_admin_bar = $this->get_standard_admin_bar();
</span><span class="cx" style="display: block; padding: 0 10px"> $node = $wp_admin_bar->get_node( 'customize' );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertNotEmpty( $node );
</span></span></pre></div>
<a id="trunktestsphpunittestsdependenciesjqueryphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/tests/phpunit/tests/dependencies/jquery.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/dependencies/jquery.php 2021-07-13 15:38:12 UTC (rev 51418)
+++ trunk/tests/phpunit/tests/dependencies/jquery.php 2021-07-13 16:13:01 UTC (rev 51419)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -82,8 +82,6 @@
</span><span class="cx" style="display: block; padding: 0 10px"> wp_deregister_script( $library );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertTrue( wp_script_is( $library, 'registered' ) );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-
- set_current_screen( 'front' );
</del><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span></span></pre></div>
<a id="trunktestsphpunittestsl10ngetUserLocalephp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/tests/phpunit/tests/l10n/getUserLocale.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/l10n/getUserLocale.php 2021-07-13 15:38:12 UTC (rev 51418)
+++ trunk/tests/phpunit/tests/l10n/getUserLocale.php 2021-07-13 16:13:01 UTC (rev 51419)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -20,12 +20,6 @@
</span><span class="cx" style="display: block; padding: 0 10px"> wp_set_current_user( $this->user_id );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- public function tearDown() {
- set_current_screen( 'front' );
-
- parent::tearDown();
- }
-
</del><span class="cx" style="display: block; padding: 0 10px"> public function test_user_locale_property() {
</span><span class="cx" style="display: block; padding: 0 10px"> set_current_screen( 'dashboard' );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertSame( 'de_DE', get_user_locale() );
</span></span></pre></div>
<a id="trunktestsphpunittestsl10nloadTextdomainphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/tests/phpunit/tests/l10n/loadTextdomain.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/l10n/loadTextdomain.php 2021-07-13 15:38:12 UTC (rev 51418)
+++ trunk/tests/phpunit/tests/l10n/loadTextdomain.php 2021-07-13 16:13:01 UTC (rev 51419)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -195,8 +195,6 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> load_muplugin_textdomain( 'wp-tests-domain' );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- set_current_screen( 'front' );
-
</del><span class="cx" style="display: block; padding: 0 10px"> $this->assertSame( get_user_locale(), $this->locale );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -215,8 +213,6 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> load_plugin_textdomain( 'wp-tests-domain' );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- set_current_screen( 'front' );
-
</del><span class="cx" style="display: block; padding: 0 10px"> $this->assertSame( get_user_locale(), $this->locale );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -235,8 +231,6 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> load_theme_textdomain( 'wp-tests-domain' );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- set_current_screen( 'front' );
-
</del><span class="cx" style="display: block; padding: 0 10px"> $this->assertSame( get_user_locale(), $this->locale );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span></span></pre></div>
<a id="trunktestsphpunittestsl10nloadTextdomainJustInTimephp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/tests/phpunit/tests/l10n/loadTextdomainJustInTime.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/l10n/loadTextdomainJustInTime.php 2021-07-13 15:38:12 UTC (rev 51418)
+++ trunk/tests/phpunit/tests/l10n/loadTextdomainJustInTime.php 2021-07-13 16:13:01 UTC (rev 51419)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -211,8 +211,6 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $expected = i18n_plugin_test();
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- set_current_screen( 'front' );
-
</del><span class="cx" style="display: block; padding: 0 10px"> $this->assertSame( 'Das ist ein Dummy Plugin', $expected );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -228,7 +226,6 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $expected = i18n_theme_test();
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- set_current_screen( 'front' );
</del><span class="cx" style="display: block; padding: 0 10px"> switch_theme( WP_DEFAULT_THEME );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertSame( 'Das ist ein Dummy Theme', $expected );
</span></span></pre></div>
<a id="trunktestsphpunittestsl10nwpLocaleSwitcherphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/tests/phpunit/tests/l10n/wpLocaleSwitcher.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/l10n/wpLocaleSwitcher.php 2021-07-13 15:38:12 UTC (rev 51418)
+++ trunk/tests/phpunit/tests/l10n/wpLocaleSwitcher.php 2021-07-13 16:13:01 UTC (rev 51419)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -284,8 +284,6 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $wp_locale_switcher = $locale_switcher;
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- set_current_screen( 'front' );
-
</del><span class="cx" style="display: block; padding: 0 10px"> $this->assertFalse( $locale_switched_user_locale );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertTrue( $locale_switched_site_locale );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertSame( $site_locale, $site_locale_after_switch );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -335,8 +333,6 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $wp_locale_switcher = $locale_switcher;
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- set_current_screen( 'front' );
-
</del><span class="cx" style="display: block; padding: 0 10px"> remove_filter( 'locale', array( $this, 'filter_locale' ) );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertFalse( $locale_switched_user_locale );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -382,8 +378,6 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $wp_locale_switcher = $locale_switcher;
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- set_current_screen( 'front' );
-
</del><span class="cx" style="display: block; padding: 0 10px"> $this->assertSame( 'en_US', get_locale() );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertSame( 'This is a dummy plugin', $expected );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span></span></pre></div>
<a id="trunktestsphpunittestsmenuwpAjaxMenuQuickSearchphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/tests/phpunit/tests/menu/wpAjaxMenuQuickSearch.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/menu/wpAjaxMenuQuickSearch.php 2021-07-13 15:38:12 UTC (rev 51418)
+++ trunk/tests/phpunit/tests/menu/wpAjaxMenuQuickSearch.php 2021-07-13 16:13:01 UTC (rev 51419)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -6,32 +6,6 @@
</span><span class="cx" style="display: block; padding: 0 10px"> class Tests_Menu_WpAjaxMenuQuickSeach extends WP_UnitTestCase {
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * Current screen.
- *
- * @var mixed
- */
- protected $current_screen;
-
- /**
- * Set up. Workaround set_current_screen( null ) not working due to $hook_suffix not being set.
- */
- function setUp() {
- parent::setUp();
-
- global $current_screen;
- $this->current_screen = $current_screen;
- }
-
- /**
- * Tear down. Workaround set_current_screen( null ) not working due to $hook_suffix not being set.
- */
- function tearDown() {
- global $current_screen;
- $current_screen = $this->current_screen;
- parent::tearDown();
- }
-
- /**
</del><span class="cx" style="display: block; padding: 0 10px"> * Test search returns results for pages.
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @ticket 27042
</span></span></pre></div>
<a id="trunktestsphpunittestspostattachmentsphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/tests/phpunit/tests/post/attachments.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/post/attachments.php 2021-07-13 15:38:12 UTC (rev 51418)
+++ trunk/tests/phpunit/tests/post/attachments.php 2021-07-13 16:13:01 UTC (rev 51419)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -410,9 +410,6 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $url = wp_get_attachment_url( $attachment_id );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- // Cleanup.
- set_current_screen( 'front' );
-
</del><span class="cx" style="display: block; padding: 0 10px"> $this->assertSame( set_url_scheme( $url, 'http' ), $url );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -438,7 +435,6 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $url = wp_get_attachment_url( $attachment_id );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Cleanup.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- set_current_screen( 'front' );
</del><span class="cx" style="display: block; padding: 0 10px"> remove_filter( 'upload_dir', '_upload_dir_https' );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertSame( 'https', parse_url( $url, PHP_URL_SCHEME ) );
</span></span></pre></div>
<a id="trunktestsphpunittestsqueryconditionalsphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/tests/phpunit/tests/query/conditionals.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/query/conditionals.php 2021-07-13 15:38:12 UTC (rev 51418)
+++ trunk/tests/phpunit/tests/query/conditionals.php 2021-07-13 16:13:01 UTC (rev 51419)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -17,8 +17,6 @@
</span><span class="cx" style="display: block; padding: 0 10px"> function setUp() {
</span><span class="cx" style="display: block; padding: 0 10px"> parent::setUp();
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- set_current_screen( 'front' );
-
</del><span class="cx" style="display: block; padding: 0 10px"> update_option( 'comments_per_page', 5 );
</span><span class="cx" style="display: block; padding: 0 10px"> update_option( 'posts_per_page', 5 );
</span><span class="cx" style="display: block; padding: 0 10px">
</span></span></pre></div>
<a id="trunktestsphpunittestsqueryisTermphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/tests/phpunit/tests/query/isTerm.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/query/isTerm.php 2021-07-13 15:38:12 UTC (rev 51418)
+++ trunk/tests/phpunit/tests/query/isTerm.php 2021-07-13 16:13:01 UTC (rev 51419)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -25,8 +25,6 @@
</span><span class="cx" style="display: block; padding: 0 10px"> function setUp() {
</span><span class="cx" style="display: block; padding: 0 10px"> parent::setUp();
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- set_current_screen( 'front' );
-
</del><span class="cx" style="display: block; padding: 0 10px"> $GLOBALS['wp_the_query'] = new WP_Query();
</span><span class="cx" style="display: block; padding: 0 10px"> $GLOBALS['wp_query'] = $GLOBALS['wp_the_query'];
</span><span class="cx" style="display: block; padding: 0 10px">
</span></span></pre></div>
<a id="trunktestsphpunittestsquerypostStatusphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/tests/phpunit/tests/query/postStatus.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/query/postStatus.php 2021-07-13 15:38:12 UTC (rev 51418)
+++ trunk/tests/phpunit/tests/query/postStatus.php 2021-07-13 16:13:01 UTC (rev 51419)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -274,7 +274,6 @@
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertContains( "post_status = 'foo", $q->request );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- set_current_screen( 'front' );
</del><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_private_statuses_should_be_included_when_current_user_can_read_private_posts() {
</span></span></pre></div>
<a id="trunktestsphpunittestsrestapiphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/tests/phpunit/tests/rest-api.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/rest-api.php 2021-07-13 15:38:12 UTC (rev 51418)
+++ trunk/tests/phpunit/tests/rest-api.php 2021-07-13 16:13:01 UTC (rev 51419)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -793,8 +793,6 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Reset.
</span><span class="cx" style="display: block; padding: 0 10px"> update_option( 'siteurl', $_siteurl );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- set_current_screen( 'front' );
-
</del><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span></span></pre></div>
<a id="trunktestsphpunittestsurlphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/tests/phpunit/tests/url.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/url.php 2021-07-13 15:38:12 UTC (rev 51418)
+++ trunk/tests/phpunit/tests/url.php 2021-07-13 16:13:01 UTC (rev 51419)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -199,8 +199,6 @@
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function test_home_url_from_admin() {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $screen = get_current_screen();
-
</del><span class="cx" style="display: block; padding: 0 10px"> // Pretend to be in the site admin.
</span><span class="cx" style="display: block; padding: 0 10px"> set_current_screen( 'dashboard' );
</span><span class="cx" style="display: block; padding: 0 10px"> $home = get_option( 'home' );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -243,13 +241,9 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertSame( $home, home_url() );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> update_option( 'home', set_url_scheme( $home, 'http' ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-
- $GLOBALS['current_screen'] = $screen;
</del><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function test_network_home_url_from_admin() {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $screen = get_current_screen();
-
</del><span class="cx" style="display: block; padding: 0 10px"> // Pretend to be in the site admin.
</span><span class="cx" style="display: block; padding: 0 10px"> set_current_screen( 'dashboard' );
</span><span class="cx" style="display: block; padding: 0 10px"> $home = network_home_url();
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -268,8 +262,6 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertSame( $home, network_home_url() );
</span><span class="cx" style="display: block; padding: 0 10px"> $_SERVER['HTTPS'] = 'on';
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertSame( $home_https, network_home_url() );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-
- $GLOBALS['current_screen'] = $screen;
</del><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function test_set_url_scheme() {
</span></span></pre></div>
<a id="trunktestsphpunittestsuserwpSendUserRequestphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/tests/phpunit/tests/user/wpSendUserRequest.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/user/wpSendUserRequest.php 2021-07-13 15:38:12 UTC (rev 51418)
+++ trunk/tests/phpunit/tests/user/wpSendUserRequest.php 2021-07-13 16:13:01 UTC (rev 51419)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -79,9 +79,6 @@
</span><span class="cx" style="display: block; padding: 0 10px"> reset_phpmailer_instance();
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> unset( $GLOBALS['locale'] );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- unset( $GLOBALS['current_screen'] );
- unset( $GLOBALS['taxnow'] );
- unset( $GLOBALS['typenow'] );
</del><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> restore_previous_locale();
</span><span class="cx" style="display: block; padding: 0 10px"> parent::tearDown();
</span></span></pre>
</div>
</div>
</body>
</html>