Changeset 40239
- Timestamp:
- 03/08/2017 12:00:47 AM (8 years ago)
- Location:
- trunk
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/pluggable.php
r40183 r40239 901 901 do_action( 'set_logged_in_cookie', $logged_in_cookie, $expire, $expiration, $user_id, 'logged_in' ); 902 902 903 /** 904 * Allows preventing auth cookies from actually being sent to the client. 905 * 906 * @since 4.7.4 907 * 908 * @param bool $send Whether to send auth cookies to the client. 909 */ 910 if ( ! apply_filters( 'send_auth_cookies', true ) ) { 911 return; 912 } 913 903 914 setcookie($auth_cookie_name, $auth_cookie, $expire, PLUGINS_COOKIE_PATH, COOKIE_DOMAIN, $secure, true); 904 915 setcookie($auth_cookie_name, $auth_cookie, $expire, ADMIN_COOKIE_PATH, COOKIE_DOMAIN, $secure, true); … … 922 933 */ 923 934 do_action( 'clear_auth_cookie' ); 935 936 /** 937 * Allows preventing auth cookies from actually being sent to the client. 938 * 939 * @since 4.7.4 940 * 941 * @param bool $send Whether to send auth cookies to the client. 942 */ 943 if ( ! apply_filters( 'send_auth_cookies', true ) ) { 944 return; 945 } 924 946 925 947 setcookie( AUTH_COOKIE, ' ', time() - YEAR_IN_SECONDS, ADMIN_COOKIE_PATH, COOKIE_DOMAIN ); -
trunk/tests/phpunit/includes/functions.php
r39219 r40239 165 165 // Skip `setcookie` calls in auth_cookie functions due to warning: 166 166 // Cannot modify header information - headers already sent by ... 167 168 function wp_set_auth_cookie( $user_id, $remember = false, $secure = '', $token = '' ) { 169 $auth_cookie = null; 170 $expire = null; 171 $expiration = null; 172 $user_id = null; 173 $scheme = null; 174 /** This action is documented in wp-inclues/pluggable.php */ 175 do_action( 'set_auth_cookie', $auth_cookie, $expire, $expiration, $user_id, $scheme ); 176 $logged_in_cookie = null; 177 /** This action is documented in wp-inclues/pluggable.php */ 178 do_action( 'set_logged_in_cookie', $logged_in_cookie, $expire, $expiration, $user_id, 'logged_in' ); 179 } 180 181 function wp_clear_auth_cookie() { 182 /** This action is documented in wp-inclues/pluggable.php */ 183 do_action( 'clear_auth_cookie' ); 184 } 167 tests_add_filter( 'send_auth_cookies', '__return_false' ); -
trunk/tests/phpunit/includes/testcase.php
r39919 r40239 175 175 $_POST = array(); 176 176 self::flush_cache(); 177 } 178 179 /** 180 * Allow tests to be skipped on some automated runs 181 * 182 * For test runs on Travis for something other than trunk/master 183 * we want to skip tests that only need to run for master. 184 */ 185 public function skipOnAutomatedBranches() { 186 // gentenv can be disabled 187 if ( ! function_exists( 'getenv' ) ) { 188 return false; 189 } 190 191 // https://docs.travis-ci.com/user/environment-variables/#Default-Environment-Variables 192 $travis_branch = getenv( 'TRAVIS_BRANCH' ); 193 $travis_pull_request = getenv( 'TRAVIS_PULL_REQUEST' ); 194 195 if ( false !== $travis_pull_request && 'master' !== $travis_branch ) { 196 $this->markTestSkipped( 'For automated test runs, this test is only run on trunk/master' ); 197 } 177 198 } 178 199 -
trunk/tests/phpunit/tests/basic.php
r39478 r40239 9 9 10 10 function test_license() { 11 // This test is designed to only run on trunk/master 12 $this->skipOnAutomatedBranches(); 13 11 14 $license = file_get_contents( ABSPATH . 'license.txt' ); 12 15 preg_match( '#Copyright 2011-(\d+) by the contributors#', $license, $matches ); -
trunk/tests/phpunit/tests/external-http/basic.php
r39583 r40239 6 6 7 7 function test_readme() { 8 // This test is designed to only run on trunk/master 9 $this->skipOnAutomatedBranches(); 10 8 11 $readme = file_get_contents( ABSPATH . 'readme.html' ); 9 12
Note: See TracChangeset
for help on using the changeset viewer.