Making WordPress.org


Ignore:
Timestamp:
09/18/2024 02:32:35 AM (4 months ago)
Author:
dd32
Message:

Make: PHPUnit Test Reporter: Update to v0.2 from GitHub:
https://github.com/WordPress/phpunit-test-reporter/releases/tag/v0.2.0

Props desrosj.
Fixes #7777.

File:
1 moved

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordpress.org/public_html/wp-content/plugins/phpunit-test-reporter/parts/result-set-single.php

    r14060 r14061  
    22use PTR\Display;
    33
    4 echo Display::get_display_css(); ?>
     4echo Display::get_display_css();
    55
    6 <table>
     6foreach ( $revisions as $revision ) :
     7
     8  $rev_id = (int) ltrim( $revision->post_name, 'r' );
     9?>
     10
     11<div class="ptr-test-reporter-single-revision">
     12    <a href="<?php echo esc_url( sprintf( 'https://core.trac.wordpress.org/changeset/%d', $rev_id ) ); ?>">
     13        r<?php echo $rev_id; ?>
     14    </a>: <?php echo esc_attr( apply_filters( 'the_title', $revision->post_title ) ); ?>
     15</div>
     16
     17<table class="ptr-test-reporter-table alignwide">
    718    <thead>
    819        <tr>
    9             <th style="width:100px">Revision</th>
    10             <th>Host</th>
    11             <th>PHP Version</th>
     20            <th style="width:100px">Status</th>
     21            <th style="width:150px">PHP Version</th>
    1222            <th>Database Version</th>
    1323        </tr>
    1424    </thead>
    1525    <tbody>
    16         <?php
    17         $total_cols = 5;
    18         foreach ( $revisions as $revision ) :
    19             $rev_id = (int) ltrim( $revision->post_name, 'r' );
    20             ?>
    21             <tr>
    22                 <th colspan="<?php echo (int) $total_cols; ?>"><a href="<?php echo esc_url( sprintf( 'https://core.trac.wordpress.org/changeset/%d', $rev_id ) ); ?>">r<?php echo (int) $rev_id; ?></a>: <?php echo wp_kses_post( apply_filters( 'the_title', $revision->post_title ) ); ?></th>
    23             </tr>
     26
    2427            <?php
    25             $query_args   = array(
     28            $query_args = array(
    2629                'posts_per_page' => $posts_per_page,
     30                'author'         => $post_author ?? null,
    2731                'post_type'      => 'result',
    2832                'post_parent'    => $revision->ID,
    29                 'orderby'        => 'post_title',
    30                 'order'          => 'ASC',
     33                'orderby'        => [ 'author' => 'ASC', 'env_name_clause' => 'ASC' ],
     34                'meta_query'     => array(
     35                    'relation' => 'OR',
     36                    'env_name_clause' => array(
     37                        'key'     => 'environment_name',
     38                        'compare' => 'EXISTS',
     39                    ),
     40                    array(
     41                        'key'     => 'environment_name',
     42                        'compare' => 'NOT EXISTS',
     43                    )
     44                ),
    3145            );
    3246            $report_query = new WP_Query( $query_args );
    3347            if ( ! empty( $report_query->posts ) ) :
     48
     49          $prev_author = null;
     50
    3451                foreach ( $report_query->posts as $report ) :
    3552                    $status       = 'Errored';
     
    5673                            )
    5774                        );
    58                         if ( ! empty( $user->user_url ) ) {
    59                             $host .= '</a>';
    60                         }
    61                         if ( ! empty( $user->user_url ) ) {
    62                             $host .= '<a target="_blank" rel="nofollow" href="' . esc_url( $user->user_url ) . '">';
    63                         }
    64                         $host .= $user->display_name;
     75
     76                        $host .= Display::get_display_reporter_name( $report->post_author );
     77
    6578                        if ( ! empty( $user->user_url ) ) {
    6679                            $host .= '</a>';
     
    6881                    }
    6982                    ?>
     83        <?php if ( $prev_author !== $host ): ?>
     84          <tr>
     85            <td colspan="3">
     86              <?php echo wp_kses_post( $host ); ?>
     87            </td>
     88          </tr>
     89
     90        <?php endif; ?>
    7091                <tr>
    71                     <td><a href="<?php echo esc_url( get_permalink( $report->ID ) ); ?>" title="<?php echo esc_attr( $status_title ); ?>" class="<?php echo esc_attr( 'ptr-status-badge ptr-status-badge-' . strtolower( $status ) ); ?>"><?php echo esc_html( $status ); ?></a></td>
    72                     <td><?php echo wp_kses_post( $host ); ?></td>
     92                    <td>
     93                        <a href="<?php echo esc_url( get_permalink( $report->ID ) ); ?>" title="<?php echo esc_attr( $status_title ); ?>" class="<?php echo esc_attr( 'ptr-status-badge ptr-status-badge-' . strtolower( $status ) ); ?>">
     94                            <?php echo esc_html( $status ); ?>
     95                        </a>
     96                    </td>
    7397                    <td><?php echo esc_html( Display::get_display_php_version( $report->ID ) ); ?></td>
    7498                    <td><?php echo esc_html( Display::get_display_mysql_version( $report->ID ) ); ?></td>
    7599                </tr>
    76100                    <?php
     101                $prev_author = $host;
    77102                endforeach;
    78103            else :
    79104                ?>
    80105                <tr>
    81                     <td></td>
    82                     <td colspan="<?php echo (int) $total_cols - 1; ?>">
     106                    <td colspan="3">
    83107                        No reports for changeset.
    84108                    </td>
    85109                </tr>
    86110            <?php endif; ?>
    87         <?php endforeach; ?>
    88111    </tbody>
    89112</table>
     113<?php endforeach;
Note: See TracChangeset for help on using the changeset viewer.