Changeset 48996
- Timestamp:
- 09/18/2020 01:22:22 PM (4 years ago)
- Location:
- trunk/tests/phpunit/tests
- Files:
-
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/ajax/DeletePlugin.php
r48939 r48996 11 11 */ 12 12 class Tests_Ajax_Delete_Plugin extends WP_Ajax_UnitTestCase { 13 /** 14 * @expectedException WPAjaxDieStopException 15 * @expectedExceptionMessage -1 16 */ 13 17 14 public function test_missing_nonce() { 15 $this->setExpectedException( 'WPAjaxDieStopException', '-1' ); 18 16 $this->_handleAjax( 'delete-plugin' ); 19 17 } -
trunk/tests/phpunit/tests/ajax/UpdatePlugin.php
r48939 r48996 11 11 */ 12 12 class Tests_Ajax_Update_Plugin extends WP_Ajax_UnitTestCase { 13 /** 14 * @expectedException WPAjaxDieStopException 15 * @expectedExceptionMessage -1 16 */ 13 17 14 public function test_missing_nonce() { 15 $this->setExpectedException( 'WPAjaxDieStopException', '-1' ); 18 16 $this->_handleAjax( 'update-plugin' ); 19 17 } -
trunk/tests/phpunit/tests/comment/wpAllowComment.php
r48121 r48996 53 53 } 54 54 55 /**56 * @expectedException WPDieException57 */58 55 public function test_die_as_duplicate_if_comment_author_name_and_emails_match() { 56 $this->expectException( 'WPDieException' ); 57 59 58 $now = time(); 60 59 $comment_data = array( -
trunk/tests/phpunit/tests/compat.php
r48937 r48996 180 180 } 181 181 182 /**183 * @expectedException PHPUnit_Framework_Error_Deprecated184 */185 182 function test_json_encode_decode() { 183 $this->expectException( 'PHPUnit_Framework_Error_Deprecated' ); 184 186 185 require_once ABSPATH . WPINC . '/class-json.php'; 187 186 $json = new Services_JSON(); -
trunk/tests/phpunit/tests/db.php
r48979 r48996 525 525 } 526 526 527 /**528 * @expectedException WPDieException529 */530 527 function test_bail() { 531 528 global $wpdb; 529 530 $this->expectException( 'WPDieException' ); 532 531 $wpdb->bail( 'Database is dead.' ); 533 532 } -
trunk/tests/phpunit/tests/formatting/redirect.php
r48937 r48996 25 25 * 26 26 * @dataProvider get_bad_status_codes 27 * @expectedException WPDieException28 27 * 29 28 * @param string $location The path or URL to redirect to. … … 31 30 */ 32 31 public function test_wp_redirect_bad_status_code( $location, $status ) { 32 $this->expectException( 'WPDieException' ); 33 33 34 wp_redirect( $location, $status ); 34 35 } -
trunk/tests/phpunit/tests/includes/helpers.php
r48939 r48996 269 269 /** 270 270 * @ticket 36166 271 * @expectedException WPDieException272 271 */ 273 272 public function test_die_handler_should_handle_wp_error() { 273 $this->expectException( 'WPDieException' ); 274 274 275 wp_die( new WP_Error( 'test', 'test' ) ); 275 276 } … … 277 278 /** 278 279 * @ticket 46813 279 * @expectedException WPDieException280 280 */ 281 281 public function test_die_handler_should_not_cause_doing_it_wrong_notice_without_wp_query_set() { 282 $this->expectException( 'WPDieException' ); 282 283 unset( $GLOBALS['wp_query'] ); 283 284 -
trunk/tests/phpunit/tests/option/option.php
r48937 r48996 102 102 /** 103 103 * @ticket 23289 104 * @expectedException WPDieException105 104 */ 106 105 function test_special_option_name_alloption() { 106 $this->expectException( 'WPDieException' ); 107 107 delete_option( 'alloptions' ); 108 108 } … … 110 110 /** 111 111 * @ticket 23289 112 * @expectedException WPDieException113 112 */ 114 113 function test_special_option_name_notoptions() { 114 $this->expectException( 'WPDieException' ); 115 115 delete_option( 'notoptions' ); 116 116 } -
trunk/tests/phpunit/tests/privacy/wpPrivacyGeneratePersonalDataExportFile.php
r48236 r48996 164 164 $request_id = wp_create_user_request( 'removal-requester@example.com', 'remove_personal_data' ); 165 165 166 $this-> setExpectedException( 'WPDieException' );166 $this->expectException( 'WPDieException' ); 167 167 $this->expectOutputString( '{"success":false,"data":"Invalid request ID when generating export file."}' ); 168 168 wp_privacy_generate_personal_data_export_file( $request_id ); … … 175 175 */ 176 176 public function test_invalid_request_id() { 177 $this-> setExpectedException( 'WPDieException' );177 $this->expectException( 'WPDieException' ); 178 178 $this->expectOutputString( '{"success":false,"data":"Invalid request ID when generating export file."}' ); 179 179 wp_privacy_generate_personal_data_export_file( 123456789 ); … … 195 195 ); 196 196 197 $this-> setExpectedException( 'WPDieException' );197 $this->expectException( 'WPDieException' ); 198 198 $this->expectOutputString( '{"success":false,"data":"Invalid email address when generating export file."}' ); 199 199 wp_privacy_generate_personal_data_export_file( $request_id ); … … 209 209 touch( untrailingslashit( self::$exports_dir ) ); 210 210 211 $this-> setExpectedException( 'WPDieException' );211 $this->expectException( 'WPDieException' ); 212 212 $this->expectOutputString( '{"success":false,"data":"Unable to create export folder."}' ); 213 213 wp_privacy_generate_personal_data_export_file( self::$export_request_id ); -
trunk/tests/phpunit/tests/privacy/wpPrivacyProcessPersonalDataExportPage.php
r48330 r48996 257 257 */ 258 258 private function _setup_expected_failure( $expected_output ) { 259 $this-> setExpectedException( 'WPDieException' );259 $this->expectException( 'WPDieException' ); 260 260 $this->expectOutputString( $expected_output ); 261 261 }
Note: See TracChangeset
for help on using the changeset viewer.