Changeset 407 in tests for wp-testlib/base.php
- Timestamp:
- 08/04/2011 08:38:26 PM (15 years ago)
- File:
-
- 1 edited
-
wp-testlib/base.php (modified) (11 diffs)
Legend:
- Unmodified
- Added
- Removed
-
wp-testlib/base.php
r373 r407 36 36 _enable_wp_die(); 37 37 } 38 38 39 39 /** 40 40 * Treat any error, which wasn't handled by PHPUnit as a failure … … 264 264 function _generate_post_content_test(&$posts, $separate_funcs = true) { 265 265 global $wpdb; 266 266 267 267 $out = ''; 268 268 if (!$separate_funcs) … … 313 313 } 314 314 } 315 315 316 316 $meta = $wpdb->get_results("SELECT DISTINCT meta_key FROM {$wpdb->postmeta} WHERE post_id = $post->ID"); 317 317 #$out .= "\t\t".'$this->assertEquals('.count($postmeta).', count($meta));'."\n"; … … 320 320 $out .= "\t\t".'$this->assertEquals('.var_export(get_post_meta($post->ID, $m->meta_key, false), true).', get_post_meta($post->ID, \''.addslashes($m->meta_key).'\', false));'."\n"; 321 321 } 322 323 322 323 324 324 $comments = $wpdb->get_results($wpdb->prepare("SELECT * FROM $wpdb->comments WHERE comment_post_ID = %d ORDER BY comment_date DESC", $post->ID)); 325 325 … … 357 357 system('mysqldump -u '.DB_USER.' --password='.DB_PASSWORD.' -cqnt '.DB_NAME.' '.$table_list); 358 358 } 359 359 360 360 function _load_sql_dump($file) { 361 361 $lines = file($file); 362 362 363 363 global $wpdb; 364 364 foreach ($lines as $line) { … … 394 394 395 395 /** 396 * Checks if track ticket #$ticket_id is resolved 396 * Checks if track ticket #$ticket_id is resolved 397 397 * 398 398 * @return bool|null true if the ticket is resolved, false if not resolved, null on error … … 452 452 } 453 453 } 454 455 454 455 456 456 // convenience function: return the # of posts associated with a tag 457 457 function _tag_count($name) { … … 460 460 return $t->count; 461 461 } 462 462 463 463 // convenience function: return the # of posts associated with a category 464 464 function _category_count($name) { … … 467 467 return $t->count; 468 468 } 469 469 470 470 } 471 471 … … 519 519 /** 520 520 * Simple function to list out all the test cases for command line interfaces 521 * 521 * 522 522 * @param $test_classes The test casses array as returned by wptest_get_all_test_cases() 523 523 * @return none … … 527 527 natcasesort( $test_classes ); 528 528 echo array_reduce($test_classes, '_wptest_listall_testcases_helper'); 529 echo "\nUse -t TestCaseName to run individual test cases\n"; 529 echo "\nUse -t TestCaseName to run individual test cases\n"; 530 530 } 531 531
Note: See TracChangeset
for help on using the changeset viewer.