Changeset 46497 for branches/4.5/tests/phpunit/tests/auth.php
- Timestamp:
- 10/14/2019 07:06:04 PM (6 years ago)
- Location:
- branches/4.5
- Files:
-
- 2 edited
-
. (modified) (1 prop)
-
tests/phpunit/tests/auth.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/4.5
- Property svn:mergeinfo changed
/trunk merged: 46474-46478,46483,46485
- Property svn:mergeinfo changed
-
branches/4.5/tests/phpunit/tests/auth.php
r36617 r46497 142 142 } 143 143 144 public function test_check_admin_referer_with_default_action_as_string_not_doing_it_wrong() { 145 // A valid nonce needs to be set so the check doesn't die() 146 $_REQUEST['_wpnonce'] = wp_create_nonce( '-1' ); 147 $result = check_admin_referer( '-1' ); 148 $this->assertSame( 1, $result ); 149 150 unset( $_REQUEST['_wpnonce'] ); 151 } 152 144 153 /** 145 154 * @ticket 24030 … … 152 161 153 162 $this->assertEquals( $count, did_action( $this->nonce_failure_hook ) ); 163 } 164 165 /** 166 * @ticket 36361 167 */ 168 public function test_check_admin_referer_with_no_action_triggers_doing_it_wrong() { 169 $this->setExpectedIncorrectUsage( 'check_admin_referer' ); 170 171 // A valid nonce needs to be set so the check doesn't die() 172 $_REQUEST['_wpnonce'] = wp_create_nonce( -1 ); 173 $result = check_admin_referer(); 174 $this->assertSame( 1, $result ); 175 176 unset( $_REQUEST['_wpnonce'] ); 177 } 178 179 /** 180 * @ticket 36361 181 */ 182 public function test_check_ajax_referer_with_no_action_triggers_doing_it_wrong() { 183 $this->setExpectedIncorrectUsage( 'check_ajax_referer' ); 184 185 // A valid nonce needs to be set so the check doesn't die() 186 $_REQUEST['_wpnonce'] = wp_create_nonce( -1 ); 187 $result = check_ajax_referer(); 188 $this->assertSame( 1, $result ); 189 190 unset( $_REQUEST['_wpnonce'] ); 154 191 } 155 192
Note: See TracChangeset
for help on using the changeset viewer.