Changeset 31469 for trunk/tests/phpunit/includes/testcase.php
- Timestamp:
- 02/17/2015 04:11:09 PM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/includes/testcase.php
r31306 r31469 56 56 } 57 57 58 /** 59 * Detect post-test failure conditions. 60 * 61 * We use this method to detect expectedDeprecated and expectedIncorrectUsage annotations. 62 * 63 * @since 4.2.0 64 */ 65 protected function assertPostConditions() { 66 $this->expectedDeprecated(); 67 } 68 58 69 function tearDown() { 59 70 global $wpdb, $wp_query, $post; 60 $this->expectedDeprecated();61 71 $wpdb->query( 'ROLLBACK' ); 62 72 if ( is_multisite() ) { … … 225 235 226 236 function expectedDeprecated() { 237 $errors = array(); 238 227 239 $not_caught_deprecated = array_diff( $this->expected_deprecated, $this->caught_deprecated ); 228 240 foreach ( $not_caught_deprecated as $not_caught ) { 229 $ this->fail( "Failed to assert that $not_caught triggered a deprecated notice" );241 $errors[] = "Failed to assert that $not_caught triggered a deprecated notice"; 230 242 } 231 243 232 244 $unexpected_deprecated = array_diff( $this->caught_deprecated, $this->expected_deprecated ); 233 245 foreach ( $unexpected_deprecated as $unexpected ) { 234 $ this->fail( "Unexpected deprecated notice for $unexpected" );246 $errors[] = "Unexpected deprecated notice for $unexpected"; 235 247 } 236 248 237 249 $not_caught_doing_it_wrong = array_diff( $this->expected_doing_it_wrong, $this->caught_doing_it_wrong ); 238 250 foreach ( $not_caught_doing_it_wrong as $not_caught ) { 239 $ this->fail( "Failed to assert that $not_caught triggered an incorrect usage notice" );251 $errors[] = "Failed to assert that $not_caught triggered an incorrect usage notice"; 240 252 } 241 253 242 254 $unexpected_doing_it_wrong = array_diff( $this->caught_doing_it_wrong, $this->expected_doing_it_wrong ); 243 255 foreach ( $unexpected_doing_it_wrong as $unexpected ) { 244 $this->fail( "Unexpected incorrect usage notice for $unexpected" ); 256 $errors[] = "Unexpected incorrect usage notice for $unexpected"; 257 } 258 259 if ( ! empty( $errors ) ) { 260 $this->fail( implode( "\n", $errors ) ); 245 261 } 246 262 }
Note: See TracChangeset
for help on using the changeset viewer.