- Timestamp:
- 05/17/2017 07:23:19 PM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sites/trunk/api.wordpress.org/public_html/events/1.0/tests/test-index.php
r5491 r5496 11 11 */ 12 12 function run_tests() { 13 global $wpdb; 13 14 define( 'RUNNING_TESTS', true ); 15 define( 'SAVEQUERIES', true ); 16 14 17 require_once( dirname( __DIR__ ) . '/index.php' ); 15 18 16 $failed = 0; 17 $failed += test_get_location(); 18 $failed += test_get_city_from_coordinates(); 19 20 printf( "\n\nFinished running all tests. %d failed.\n", $failed ); 19 $tests_failed = 0; 20 $tests_failed += test_get_location(); 21 $tests_failed += test_get_city_from_coordinates(); 22 $query_count = count( $wpdb->queries ); 23 $query_time = array_sum( array_column( $wpdb->queries, 1 ) ); 24 25 printf( 26 "\n\nFinished running all tests.\n\n* %d tests failed\n* %d queries ran in %f seconds\n* Average time per query: %f seconds\n", 27 $tests_failed, 28 $query_count, 29 $query_time, 30 $query_time / $query_count 31 ); 21 32 } 22 33
Note: See TracChangeset
for help on using the changeset viewer.