Changeset 48997
- Timestamp:
- 09/18/2020 01:48:27 PM (4 years ago)
- Location:
- trunk/tests/phpunit/tests/ajax
- Files:
-
- 12 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/ajax/Compression.php
r48937 r48997 26 26 27 27 // Make the request. 28 $this->setExpectedException( 'WPAjaxDieStopException', '-1' ); 28 $this->expectException( 'WPAjaxDieStopException' ); 29 $this->expectExceptionMessage( '-1' ); 29 30 $this->_handleAjax( 'wp-compression-test' ); 30 31 } … … 119 120 120 121 // Make the request. 121 $this->setExpectedException( 'WPAjaxDieStopException', '-1' ); 122 $this->expectException( 'WPAjaxDieStopException' ); 123 $this->expectExceptionMessage( '-1' ); 122 124 $this->_handleAjax( 'wp-compression-test' ); 123 125 } -
trunk/tests/phpunit/tests/ajax/CustomizeMenus.php
r48937 r48997 54 54 55 55 if ( 'administrator' !== $role ) { 56 // If we're not an admin, we should get a wp_die(-1). 57 $this->setExpectedException( 'WPAjaxDieStopException', '-1' ); 56 // If we're not an admin, we should get a wp_die( -1 ). 57 $this->expectException( 'WPAjaxDieStopException' ); 58 $this->expectExceptionMessage( '-1' ); 58 59 } 59 60 … … 443 444 444 445 if ( 'administrator' !== $role ) { 445 // If we're not an admin, we should get a wp_die(-1). 446 $this->setExpectedException( 'WPAjaxDieStopException', '-1' ); 446 // If we're not an admin, we should get a wp_die( -1 ). 447 $this->expectException( 'WPAjaxDieStopException' ); 448 $this->expectExceptionMessage( '-1' ); 447 449 } 448 450 -
trunk/tests/phpunit/tests/ajax/DeleteComment.php
r48937 r48997 138 138 139 139 // Make the request. 140 $this->setExpectedException( 'WPAjaxDieStopException', '-1' ); 140 $this->expectException( 'WPAjaxDieStopException' ); 141 $this->expectExceptionMessage( '-1' ); 141 142 $this->_handleAjax( 'delete-comment' ); 142 143 } … … 169 170 170 171 // Make the request. 171 $this->setExpectedException( 'WPAjaxDieStopException', '-1' ); 172 $this->expectException( 'WPAjaxDieStopException' ); 173 $this->expectExceptionMessage( '-1' ); 172 174 $this->_handleAjax( 'delete-comment' ); 173 175 } -
trunk/tests/phpunit/tests/ajax/DeletePlugin.php
r48996 r48997 13 13 14 14 public function test_missing_nonce() { 15 $this->setExpectedException( 'WPAjaxDieStopException', '-1' ); 15 $this->expectException( 'WPAjaxDieStopException' ); 16 $this->expectExceptionMessage( '-1' ); 16 17 $this->_handleAjax( 'delete-plugin' ); 17 18 } -
trunk/tests/phpunit/tests/ajax/DimComment.php
r48937 r48997 131 131 132 132 // Make the request. 133 $this->setExpectedException( 'WPAjaxDieStopException', '-1' ); 133 $this->expectException( 'WPAjaxDieStopException' ); 134 $this->expectExceptionMessage( '-1' ); 134 135 $this->_handleAjax( 'dim-comment' ); 135 136 } … … 159 160 160 161 // Make the request. 161 $this->setExpectedException( 'WPAjaxDieStopException', '-1' ); 162 $this->expectException( 'WPAjaxDieStopException' ); 163 $this->expectExceptionMessage( '-1' ); 162 164 $this->_handleAjax( 'dim-comment' ); 163 165 } -
trunk/tests/phpunit/tests/ajax/EditComment.php
r48937 r48997 150 150 151 151 // Make the request. 152 $this->setExpectedException( 'WPAjaxDieStopException', '-1' ); 152 $this->expectException( 'WPAjaxDieStopException' ); 153 $this->expectExceptionMessage( '-1' ); 153 154 $this->_handleAjax( 'edit-comment' ); 154 155 } … … 178 179 179 180 // Make the request. 180 $this->setExpectedException( 'WPAjaxDieStopException', '-1' ); 181 $this->expectException( 'WPAjaxDieStopException' ); 182 $this->expectExceptionMessage( '-1' ); 181 183 $this->_handleAjax( 'get-comments' ); 182 184 } … … 198 200 199 201 // Make the request. 200 $this->setExpectedException( 'WPAjaxDieStopException', '-1' ); 202 $this->expectException( 'WPAjaxDieStopException' ); 203 $this->expectExceptionMessage( '-1' ); 201 204 $this->_handleAjax( 'edit-comment' ); 202 205 } … … 226 229 227 230 // Make the request. 228 $this->setExpectedException( 'WPAjaxDieStopException', 'wp_update_comment_data filter fails for this comment.' ); 231 $this->expectException( 'WPAjaxDieStopException' ); 232 $this->expectExceptionMessage( 'wp_update_comment_data filter fails for this comment.' ); 229 233 $this->_handleAjax( 'edit-comment' ); 230 234 } -
trunk/tests/phpunit/tests/ajax/GetComments.php
r48937 r48997 91 91 92 92 // Make the request. 93 $this->setExpectedException( 'WPAjaxDieStopException', '-1' ); 93 $this->expectException( 'WPAjaxDieStopException' ); 94 $this->expectExceptionMessage( '-1' ); 94 95 $this->_handleAjax( 'get-comments' ); 95 96 } … … 111 112 112 113 // Make the request. 113 $this->setExpectedException( 'WPAjaxDieStopException', '-1' ); 114 $this->expectException( 'WPAjaxDieStopException' ); 115 $this->expectExceptionMessage( '-1' ); 114 116 $this->_handleAjax( 'get-comments' ); 115 117 } … … 131 133 132 134 // Make the request. 133 $this->setExpectedException( 'WPAjaxDieStopException', '-1' ); 135 $this->expectException( 'WPAjaxDieStopException' ); 136 $this->expectExceptionMessage( '-1' ); 134 137 $this->_handleAjax( 'get-comments' ); 135 138 } … … 149 152 150 153 // Make the request. 151 $this->setExpectedException( 'WPAjaxDieStopException', '1' ); 154 $this->expectException( 'WPAjaxDieStopException' ); 155 $this->expectExceptionMessage( '1' ); 152 156 $this->_handleAjax( 'get-comments' ); 153 157 } -
trunk/tests/phpunit/tests/ajax/PrivacyErasePersonalData.php
r48100 r48997 332 332 */ 333 333 public function test_failure_with_invalid_nonce() { 334 $this->setExpectedException( 'WPAjaxDieStopException', '-1' ); 334 $this->expectException( 'WPAjaxDieStopException' ); 335 $this->expectExceptionMessage( '-1' ); 335 336 336 337 $this->_make_ajax_call( -
trunk/tests/phpunit/tests/ajax/PrivacyExportPersonalData.php
r47122 r48997 293 293 */ 294 294 public function test_failure_with_invalid_nonce() { 295 $this->setExpectedException( 'WPAjaxDieStopException', '-1' ); 295 $this->expectException( 'WPAjaxDieStopException' ); 296 $this->expectExceptionMessage( '-1' ); 296 297 297 298 $this->_make_ajax_call( -
trunk/tests/phpunit/tests/ajax/ReplytoComment.php
r48937 r48997 114 114 115 115 // Make the request. 116 $this->setExpectedException( 'WPAjaxDieStopException', '-1' ); 116 $this->expectException( 'WPAjaxDieStopException' ); 117 $this->expectExceptionMessage( '-1' ); 117 118 $this->_handleAjax( 'replyto-comment' ); 118 119 } … … 143 144 144 145 // Make the request. 145 $this->setExpectedException( 'WPAjaxDieStopException', '-1' ); 146 $this->expectException( 'WPAjaxDieStopException' ); 147 $this->expectExceptionMessage( '-1' ); 146 148 $this->_handleAjax( 'replyto-comment' ); 147 149 } … … 163 165 164 166 // Make the request. 165 $this->setExpectedException( 'WPAjaxDieStopException', '-1' ); 167 $this->expectException( 'WPAjaxDieStopException' ); 168 $this->expectExceptionMessage( '-1' ); 166 169 $this->_handleAjax( 'replyto-comment' ); 167 170 } … … 183 186 184 187 // Make the request. 185 $this->setExpectedException( 'WPAjaxDieStopException', 'Error: You can’t reply to a comment on a draft post.' ); 188 $this->expectException( 'WPAjaxDieStopException' ); 189 $this->expectExceptionMessage( 'Error: You can’t reply to a comment on a draft post.' ); 186 190 $this->_handleAjax( 'replyto-comment' ); 187 191 } … … 253 257 254 258 // Make the request. 255 $this->setExpectedException( 'WPAjaxDieStopException', 'pre_comment_approved filter fails for new comment' ); 259 $this->expectException( 'WPAjaxDieStopException' ); 260 $this->expectExceptionMessage( 'pre_comment_approved filter fails for new comment.' ); 256 261 $this->_handleAjax( 'replyto-comment' ); 257 262 } … … 261 266 */ 262 267 function _pre_comment_approved_filter( $approved, $commentdata ) { 263 return new WP_Error( 'comment_wrong', 'pre_comment_approved filter fails for new comment ', 403 );268 return new WP_Error( 'comment_wrong', 'pre_comment_approved filter fails for new comment.', 403 ); 264 269 } 265 270 } -
trunk/tests/phpunit/tests/ajax/TagSearch.php
r48937 r48997 75 75 // Make the request. 76 76 // No output, so we get a stop exception. 77 $this->setExpectedException( 'WPAjaxDieStopException', '' ); 77 $this->expectException( 'WPAjaxDieStopException' ); 78 $this->expectExceptionMessage( '' ); 78 79 $this->_handleAjax( 'ajax-tag-search' ); 79 80 } … … 115 116 116 117 // Make the request. 117 $this->setExpectedException( 'WPAjaxDieStopException', '-1' ); 118 $this->expectException( 'WPAjaxDieStopException' ); 119 $this->expectExceptionMessage( '-1' ); 118 120 $this->_handleAjax( 'ajax-tag-search' ); 119 121 } … … 132 134 133 135 // Make the request. 134 $this->setExpectedException( 'WPAjaxDieStopException', '0' ); 136 $this->expectException( 'WPAjaxDieStopException' ); 137 $this->expectExceptionMessage( '0' ); 135 138 $this->_handleAjax( 'ajax-tag-search' ); 136 139 } … … 149 152 150 153 // Make the request. 151 $this->setExpectedException( 'WPAjaxDieStopException', '-1' ); 154 $this->expectException( 'WPAjaxDieStopException' ); 155 $this->expectExceptionMessage( '-1' ); 152 156 $this->_handleAjax( 'ajax-tag-search' ); 153 157 } -
trunk/tests/phpunit/tests/ajax/UpdatePlugin.php
r48996 r48997 13 13 14 14 public function test_missing_nonce() { 15 $this->setExpectedException( 'WPAjaxDieStopException', '-1' ); 15 $this->expectException( 'WPAjaxDieStopException' ); 16 $this->expectExceptionMessage( '-1' ); 16 17 $this->_handleAjax( 'update-plugin' ); 17 18 }
Note: See TracChangeset
for help on using the changeset viewer.