Changeset 14061 for sites/trunk/wordpress.org/public_html/wp-content/plugins/phpunit-test-reporter/phpunit-test-reporter.php
- Timestamp:
- 09/18/2024 02:32:35 AM (4 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sites/trunk/wordpress.org/public_html/wp-content/plugins/phpunit-test-reporter/phpunit-test-reporter.php
r11328 r14061 8 8 * Text Domain: ptr 9 9 * Domain Path: /languages 10 * Version: 0. 1.310 * Version: 0.2.0 11 11 * License: GPL v3 12 12 * … … 30 30 add_action( 'the_content', array( 'PTR\Display', 'filter_the_content' ) ); 31 31 add_action( 'rest_api_init', array( 'PTR\RestAPI', 'register_routes' ) ); 32 33 32 add_action( 'load-edit.php', 'ptr_load_edit_php' ); 34 33 … … 94 93 return ob_get_clean(); 95 94 } 95 96 /** 97 * Counts the number of failing or passing test reports for a revision. 98 * 99 * @param int $revision_parent_id The current revision's post ID. 100 * @param string $status The status term slug to count. 101 * 102 * @return int The number of reports for the given revision. 103 */ 104 function ptr_count_test_results( $revision_parent_id, $status = 'passed' ) { 105 $report_query = new WP_Query( 106 array( 107 'post_type' => 'result', 108 'post_parent' => $revision_parent_id, 109 'fields' => 'ids', 110 'posts_per_page' => 1, 111 'tax_query' => array( 112 array( 113 'taxonomy' => 'report-result', 114 'terms' => $status, 115 'field' => 'slug', 116 ), 117 ) 118 ) 119 ); 120 121 if ( ! $report_query->have_posts() ) { 122 return 0; 123 } 124 125 return $report_query->found_posts; 126 }
Note: See TracChangeset
for help on using the changeset viewer.