Making WordPress.org


Ignore:
Timestamp:
08/16/2017 01:10:07 PM (9 years ago)
Author:
danielbachhuber
Message:

phpunit-test-reporter: Misc display changes

  • Use rewrite rule hackery for consistent breadcrumbs
  • Display test result timing when present
  • Drop empty column from table view

See #2981

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  
    4242                                ),
    4343                        ) );
     44                        $content = '<p><a href="' . esc_url( home_url( 'test-results/' ) ) . '">&larr; Test Results</a></p>' . PHP_EOL . PHP_EOL . $content;
    4445                }
    4546
     
    122123                <?php
    123124                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";
    124140        }
    125141
Note: See TracChangeset for help on using the changeset viewer.