Changeset 37150
- Timestamp:
- 03/30/2016 07:52:14 PM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/ajax/Compression.php
r35211 r37150 144 144 } 145 145 146 // Check the site option 146 // Check the site option is not changed due to lack of nonce 147 $this->assertEquals( 0, get_site_option( 'can_compress_scripts' ) ); 148 149 // Add a nonce 150 $_GET['_ajax_nonce'] = wp_create_nonce( 'update_can_compress_scripts' ); 151 152 // Retry the request 153 try { 154 $this->_handleAjax( 'wp-compression-test' ); 155 } catch ( WPAjaxDieStopException $e ) { 156 unset( $e ); 157 } 158 159 // Check the site option is changed 147 160 $this->assertEquals( 1, get_site_option( 'can_compress_scripts' ) ); 148 161 } … … 169 182 } 170 183 171 // Check the site option 184 // Check the site option is not changed due to lack of nonce 185 $this->assertEquals( 1, get_site_option( 'can_compress_scripts' ) ); 186 187 // Add a nonce 188 $_GET['_ajax_nonce'] = wp_create_nonce( 'update_can_compress_scripts' ); 189 190 // Retry the request 191 try { 192 $this->_handleAjax( 'wp-compression-test' ); 193 } catch ( WPAjaxDieStopException $e ) { 194 unset( $e ); 195 } 196 197 // Check the site option is changed 172 198 $this->assertEquals( 0, get_site_option( 'can_compress_scripts' ) ); 173 199 }
Note: See TracChangeset
for help on using the changeset viewer.