Changeset 5806 for sites/trunk/wordpress.org/public_html/wp-content/plugins/phpunit-test-reporter/src/class-display.php
- Timestamp:
- 08/16/2017 01:10:07 PM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sites/trunk/wordpress.org/public_html/wp-content/plugins/phpunit-test-reporter/src/class-display.php
r5805 r5806 42 42 ), 43 43 ) ); 44 $content = '<p><a href="' . esc_url( home_url( 'test-results/' ) ) . '">← Test Results</a></p>' . PHP_EOL . PHP_EOL . $content; 44 45 } 45 46 … … 122 123 <?php 123 124 return ob_get_clean(); 125 } 126 127 /** 128 * Get the time for display 129 * 130 * @return string 131 */ 132 public static function get_display_time( $report_id ) { 133 $results = get_post_meta( $report_id, 'results', true ); 134 if ( empty( $results['time'] ) ) { 135 return ''; 136 } 137 $minutes = floor( ( (int) $results['time'] / 60 ) % 60 ); 138 $seconds = (int) $results['time'] % 60; 139 return "{$minutes}m {$seconds}s"; 124 140 } 125 141
Note: See TracChangeset
for help on using the changeset viewer.