Changeset 9884
- Timestamp:
- 05/19/2020 05:33:14 AM (4 years ago)
- 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 18 18 foreach ( $revisions as $revision ) : 19 19 $rev_id = (int) ltrim( $revision->post_name, 'r' ); 20 ?>20 ?> 21 21 <tr> 22 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> … … 24 24 <?php 25 25 $query_args = array( 26 'posts_per_page' => 10,26 'posts_per_page' => $posts_per_page, 27 27 'post_type' => 'result', 28 28 'post_parent' => $revision->ID, … … 48 48 } 49 49 $host .= get_avatar( 50 $user->ID, 18, '', '', array( 50 $user->ID, 51 18, 52 '', 53 '', 54 array( 51 55 'extra_attr' => 'style="vertical-align: middle;margin-right:5px;"', 52 56 ) … … 70 74 <td><?php echo esc_html( Display::get_display_mysql_version( $report->ID ) ); ?></td> 71 75 </tr> 72 <?php76 <?php 73 77 endforeach; 74 78 else : 75 ?>79 ?> 76 80 <tr> 77 81 <td></td> -
sites/trunk/wordpress.org/public_html/wp-content/plugins/phpunit-test-reporter/parts/single-result.php
r7227 r9884 17 17 } 18 18 $host .= get_avatar( 19 $user->ID, 18, '', '', array( 19 $user->ID, 20 18, 21 '', 22 '', 23 array( 20 24 'extra_attr' => 'style="vertical-align: middle;margin-right:5px;"', 21 25 ) … … 38 42 $parent = get_post( $report->post_parent ); 39 43 if ( $parent ) : 40 ?>44 ?> 41 45 <p><a href="<?php echo esc_url( get_permalink( $parent ) ); ?>">← <?php echo esc_html( $parent->post_name ) . ': ' . apply_filters( 'the_title', get_the_title( $parent ) ); ?></a></p> 42 46 <?php endif; ?> … … 74 78 } 75 79 foreach ( $testsuite['testcases'] as $test_name => $testcase ) : 76 ?>80 ?> 77 81 <p><strong><?php echo esc_html( $suite_name . '::' . $test_name ); ?></strong></p> 78 82 <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 2 2 /** 3 3 * 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/ 5 5 * Description: Captures and displays test results from the PHPUnit Test Runner 6 6 * Author: WordPress Hosting Community … … 8 8 * Text Domain: ptr 9 9 * Domain Path: /languages 10 * Version: 0.1. 010 * Version: 0.1.2 11 11 * License: GPL v3 12 12 * -
sites/trunk/wordpress.org/public_html/wp-content/plugins/phpunit-test-reporter/readme.txt
r6262 r9884 1 1 === PHPUnit Test Reporter === 2 Contributors: octalmage, danielbachhuber 2 Contributors: octalmage, danielbachhuber, wpamitkumar, mikeschroder, pfefferle 3 3 Tags: phpunit 4 4 Requires at least: 4.7 5 Tested up to: 4.86 Stable tag: 0.1. 05 Tested up to: 5.4.1 6 Stable tag: 0.1.2 7 7 License: GPLv3 8 8 License URI: http://www.gnu.org/licenses/gpl-3.0.html … … 12 12 == Description == 13 13 14 Captures and displays test results from the PHPUnit Test Runner14 Captures and displays test results from the [PHPUnit Test Runner](https://github.com/WordPress/phpunit-test-runner). 15 15 16 16 For more details, [please read through the project overview](https://make.wordpress.org/hosting/test-results-getting-started/). 17 18 == Contributing == 19 20 There’s a Docker environment with several tools built in for testing. 21 To configure it, run `make` and it will automatically run `docker-compose`. 22 After that, to view the test environment, visit http://localhost:8080. 23 24 Usage: 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 30 There is also a [Grunt](https://gruntjs.com/) command for updating the `README.md` file for Github 31 after updating `readme.txt`. 32 33 Usage: 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)`. 17 37 18 38 == Changelog == … … 20 40 = 0.1.0 (August 21st, 2017) = 21 41 * 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 51 51 if ( ! get_role( 'test-reporter' ) ) { 52 52 add_role( 53 'test-reporter', __( 'Test Reporter', 'ptr' ), array( 53 'test-reporter', 54 __( 'Test Reporter', 'ptr' ), 55 array( 54 56 'read' => true, 55 57 ) -
sites/trunk/wordpress.org/public_html/wp-content/plugins/phpunit-test-reporter/src/class-display.php
r6634 r9884 68 68 if ( get_queried_object()->post_parent ) { 69 69 $content = ptr_get_template_part( 70 'single-result', array( 70 'single-result', 71 array( 71 72 'report' => get_queried_object(), 72 73 ) … … 74 75 } else { 75 76 $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( 78 81 get_queried_object(), 79 82 ), … … 93 96 $output = ''; 94 97 $query_args = array( 95 'posts_per_page' => 5,98 'posts_per_page' => 3, 96 99 'post_type' => 'result', 97 100 'post_parent' => 0, … … 119 122 } 120 123 $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, 123 128 ) 124 129 ); -
sites/trunk/wordpress.org/public_html/wp-content/plugins/phpunit-test-reporter/src/class-restapi.php
r6522 r9884 13 13 public static function register_routes() { 14 14 register_rest_route( 15 'wp-unit-test-api/v1', 'results', array( 15 'wp-unit-test-api/v1', 16 'results', 17 array( 16 18 'methods' => 'POST', 17 19 'callback' => array( __CLASS__, 'add_results_callback' ), … … 52 54 if ( ! is_numeric( $value ) ) { 53 55 return new WP_Error( 54 'rest_invalid', __( 'Value must be numeric.', 'ptr' ), array( 56 'rest_invalid', 57 __( 'Value must be numeric.', 'ptr' ), 58 array( 55 59 'status' => 400, 56 60 ) … … 61 65 if ( empty( $value ) || ! is_string( $value ) ) { 62 66 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( 64 70 'status' => 400, 65 71 ) … … 71 77 if ( null === json_decode( $value ) ) { 72 78 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( 74 82 'status' => 400, 75 83 ) … … 79 87 } 80 88 return new WP_Error( 81 'rest_invalid', __( 'Invalid key specified.', 'ptr' ), array( 89 'rest_invalid', 90 __( 'Invalid key specified.', 'ptr' ), 91 array( 82 92 'status' => 400, 83 93 ) … … 88 98 if ( ! current_user_can( 'edit_results' ) ) { 89 99 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( 91 103 'status' => is_user_logged_in() ? 403 : 401, 92 104 )
Note: See TracChangeset
for help on using the changeset viewer.