Making WordPress.org

Changeset 9884


Ignore:
Timestamp:
05/19/2020 05:33:14 AM (4 years ago)
Author:
dd32
Message:

Bump the PHPUnit Test Reporter plugin to v0.1.2

Props mikeschroder.
Fixes #5214.

Location:
sites/trunk/wordpress.org/public_html/wp-content/plugins/phpunit-test-reporter
Files:
7 edited

Legend:

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

    r7227 r9884  
    1818        foreach ( $revisions as $revision ) :
    1919            $rev_id = (int) ltrim( $revision->post_name, 'r' );
    20         ?>
     20            ?>
    2121            <tr>
    2222                <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>
     
    2424            <?php
    2525            $query_args   = array(
    26                 'posts_per_page' => 10,
     26                'posts_per_page' => $posts_per_page,
    2727                'post_type'      => 'result',
    2828                'post_parent'    => $revision->ID,
     
    4848                        }
    4949                        $host .= get_avatar(
    50                             $user->ID, 18, '', '', array(
     50                            $user->ID,
     51                            18,
     52                            '',
     53                            '',
     54                            array(
    5155                                'extra_attr' => 'style="vertical-align: middle;margin-right:5px;"',
    5256                            )
     
    7074                    <td><?php echo esc_html( Display::get_display_mysql_version( $report->ID ) ); ?></td>
    7175                </tr>
    72             <?php
     76                    <?php
    7377                endforeach;
    7478            else :
    75             ?>
     79                ?>
    7680                <tr>
    7781                    <td></td>
  • sites/trunk/wordpress.org/public_html/wp-content/plugins/phpunit-test-reporter/parts/single-result.php

    r7227 r9884  
    1717    }
    1818    $host .= get_avatar(
    19         $user->ID, 18, '', '', array(
     19        $user->ID,
     20        18,
     21        '',
     22        '',
     23        array(
    2024            'extra_attr' => 'style="vertical-align: middle;margin-right:5px;"',
    2125        )
     
    3842$parent = get_post( $report->post_parent );
    3943if ( $parent ) :
    40 ?>
     44    ?>
    4145<p><a href="<?php echo esc_url( get_permalink( $parent ) ); ?>">&larr; <?php echo esc_html( $parent->post_name ) . ': ' . apply_filters( 'the_title', get_the_title( $parent ) ); ?></a></p>
    4246<?php endif; ?>
     
    7478        }
    7579        foreach ( $testsuite['testcases'] as $test_name => $testcase ) :
    76         ?>
     80            ?>
    7781        <p><strong><?php echo esc_html( $suite_name . '::' . $test_name ); ?></strong></p>
    7882        <pre><?php echo ! empty( $testcase['failure'] ) ? $testcase['failure'] : $testcase['error']; ?></pre>
  • sites/trunk/wordpress.org/public_html/wp-content/plugins/phpunit-test-reporter/phpunit-test-reporter.php

    r5826 r9884  
    22/**
    33 * Plugin Name:     PHPUnit Test Reporter
    4  * Plugin URI:      https://make.wordpress.org/hosting/phpunit-test-results/
     4 * Plugin URI:      https://make.wordpress.org/hosting/test-results/
    55 * Description:     Captures and displays test results from the PHPUnit Test Runner
    66 * Author:          WordPress Hosting Community
     
    88 * Text Domain:     ptr
    99 * Domain Path:     /languages
    10  * Version:         0.1.0
     10 * Version:         0.1.2
    1111 * License:         GPL v3
    1212 *
  • sites/trunk/wordpress.org/public_html/wp-content/plugins/phpunit-test-reporter/readme.txt

    r6262 r9884  
    11=== PHPUnit Test Reporter ===
    2 Contributors: octalmage, danielbachhuber
     2Contributors: octalmage, danielbachhuber, wpamitkumar, mikeschroder, pfefferle
    33Tags: phpunit
    44Requires at least: 4.7
    5 Tested up to: 4.8
    6 Stable tag: 0.1.0
     5Tested up to: 5.4.1
     6Stable tag: 0.1.2
    77License: GPLv3
    88License URI: http://www.gnu.org/licenses/gpl-3.0.html
     
    1212== Description ==
    1313
    14 Captures and displays test results from the PHPUnit Test Runner
     14Captures and displays test results from the [PHPUnit Test Runner](https://github.com/WordPress/phpunit-test-runner).
    1515
    1616For more details, [please read through the project overview](https://make.wordpress.org/hosting/test-results-getting-started/).
     17
     18== Contributing ==
     19
     20There’s a Docker environment with several tools built in for testing.
     21To configure it, run `make` and it will automatically run `docker-compose`.
     22After that, to view the test environment, visit http://localhost:8080.
     23
     24Usage:
     25- `make` or `make start`:  Builds a Docker environment for testing.
     26- `make stop`: Stops Docker test environment.
     27- `make shell`: SSH to Docker test environment.
     28- `make test`: Runs `php-unit` and `phpcs` in Docker test environment.
     29
     30There is also a [Grunt](https://gruntjs.com/) command for updating the `README.md` file for Github
     31after updating `readme.txt`.
     32
     33Usage:
     34- `npm install`: Installs necessary dependencies.
     35- `grunt readme`: Generates `README.md` with
     36  `[grunt-wp-readme-to-markdown](https://github.com/stephenharris/wp-readme-to-markdown)`.
    1737
    1838== Changelog ==
     
    2040= 0.1.0 (August 21st, 2017) =
    2141* Initial release.
     42
     43= 0.1.1 (May 12th, 2020) =
     44* Updates for coding standards.
     45* Update local and Travis CI builds.
     46* Reduce number of revisions in index, while increasing max reporters shown.
     47* Add contributor documentation.
     48
     49= 0.1.2 (May 18th, 2020) =
     50* Only report result status when tests were actually run. Port of
     51  [meta #7227](https://meta.trac.wordpress.org/changeset/7227) to plugin.
     52* Upgrade packages for `grunt readme` to Grunt ^1.1.0 and
     53  grunt-wp-readme-to-markdown ^2.0.1, and update plugin version in `package.json`.
     54* Upgrade Docker environment to use `wordpress:5.4.1-php7.4` image.
     55* Correct contributor list in `readme.txt` and update `README.md`.
  • sites/trunk/wordpress.org/public_html/wp-content/plugins/phpunit-test-reporter/src/class-content-model.php

    r6262 r9884  
    5151        if ( ! get_role( 'test-reporter' ) ) {
    5252            add_role(
    53                 'test-reporter', __( 'Test Reporter', 'ptr' ), array(
     53                'test-reporter',
     54                __( 'Test Reporter', 'ptr' ),
     55                array(
    5456                    'read' => true,
    5557                )
  • sites/trunk/wordpress.org/public_html/wp-content/plugins/phpunit-test-reporter/src/class-display.php

    r6634 r9884  
    6868        if ( get_queried_object()->post_parent ) {
    6969            $content = ptr_get_template_part(
    70                 'single-result', array(
     70                'single-result',
     71                array(
    7172                    'report' => get_queried_object(),
    7273                )
     
    7475        } else {
    7576            $content = ptr_get_template_part(
    76                 'result-set', array(
    77                     'revisions' => array(
     77                'result-set',
     78                array(
     79                    'posts_per_page' => 500,
     80                    'revisions'      => array(
    7881                        get_queried_object(),
    7982                    ),
     
    9396        $output     = '';
    9497        $query_args = array(
    95             'posts_per_page' => 5,
     98            'posts_per_page' => 3,
    9699            'post_type'      => 'result',
    97100            'post_parent'    => 0,
     
    119122        }
    120123        $output .= ptr_get_template_part(
    121             'result-set', array(
    122                 'revisions' => $rev_query->posts,
     124            'result-set',
     125            array(
     126                'posts_per_page' => 50,
     127                'revisions'      => $rev_query->posts,
    123128            )
    124129        );
  • sites/trunk/wordpress.org/public_html/wp-content/plugins/phpunit-test-reporter/src/class-restapi.php

    r6522 r9884  
    1313    public static function register_routes() {
    1414        register_rest_route(
    15             'wp-unit-test-api/v1', 'results', array(
     15            'wp-unit-test-api/v1',
     16            'results',
     17            array(
    1618                'methods'             => 'POST',
    1719                'callback'            => array( __CLASS__, 'add_results_callback' ),
     
    5254                if ( ! is_numeric( $value ) ) {
    5355                    return new WP_Error(
    54                         'rest_invalid', __( 'Value must be numeric.', 'ptr' ), array(
     56                        'rest_invalid',
     57                        __( 'Value must be numeric.', 'ptr' ),
     58                        array(
    5559                            'status' => 400,
    5660                        )
     
    6165                if ( empty( $value ) || ! is_string( $value ) ) {
    6266                    return new WP_Error(
    63                         'rest_invalid', __( 'Value must be a non-empty string.', 'ptr' ), array(
     67                        'rest_invalid',
     68                        __( 'Value must be a non-empty string.', 'ptr' ),
     69                        array(
    6470                            'status' => 400,
    6571                        )
     
    7177                if ( null === json_decode( $value ) ) {
    7278                    return new WP_Error(
    73                         'rest_invalid', __( 'Value must be encoded JSON.', 'ptr' ), array(
     79                        'rest_invalid',
     80                        __( 'Value must be encoded JSON.', 'ptr' ),
     81                        array(
    7482                            'status' => 400,
    7583                        )
     
    7987        }
    8088        return new WP_Error(
    81             'rest_invalid', __( 'Invalid key specified.', 'ptr' ), array(
     89            'rest_invalid',
     90            __( 'Invalid key specified.', 'ptr' ),
     91            array(
    8292                'status' => 400,
    8393            )
     
    8898        if ( ! current_user_can( 'edit_results' ) ) {
    8999            return new WP_Error(
    90                 'rest_unauthorized', __( 'Sorry, you are not allowed to create results.', 'ptr' ), array(
     100                'rest_unauthorized',
     101                __( 'Sorry, you are not allowed to create results.', 'ptr' ),
     102                array(
    91103                    'status' => is_user_logged_in() ? 403 : 401,
    92104                )
Note: See TracChangeset for help on using the changeset viewer.