<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[6262] sites/trunk/wordpress.org/public_html/wp-content/plugins/phpunit-test-reporter: phpunit-test-reporter: Clean up formatting with phpcbf</title>
</head>
<body>
<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; }
#msg dl a { font-weight: bold}
#msg dl a:link { color:#fc3; }
#msg dl a:active { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta" style="font-size: 105%">
<dt style="float: left; width: 6em; font-weight: bold">Revision</dt> <dd><a style="font-weight: bold" href="http://meta.trac.wordpress.org/changeset/6262">6262</a><script type="application/ld+json">{"@context":"http://schema.org","@type":"EmailMessage","description":"Review this Commit","action":{"@type":"ViewAction","url":"http://meta.trac.wordpress.org/changeset/6262","name":"Review Commit"}}</script></dd>
<dt style="float: left; width: 6em; font-weight: bold">Author</dt> <dd>danielbachhuber</dd>
<dt style="float: left; width: 6em; font-weight: bold">Date</dt> <dd>2017-12-13 19:27:11 +0000 (Wed, 13 Dec 2017)</dd>
</dl>
<pre style='padding-left: 1em; margin: 2em 0; border-left: 2px solid #ccc; line-height: 1.25; font-size: 105%; font-family: sans-serif'>phpunit-test-reporter: Clean up formatting with phpcbf</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#sitestrunkwordpressorgpublic_htmlwpcontentpluginsphpunittestreporterpartsresultsetphp">sites/trunk/wordpress.org/public_html/wp-content/plugins/phpunit-test-reporter/parts/result-set.php</a></li>
<li><a href="#sitestrunkwordpressorgpublic_htmlwpcontentpluginsphpunittestreporterpartssingleresultphp">sites/trunk/wordpress.org/public_html/wp-content/plugins/phpunit-test-reporter/parts/single-result.php</a></li>
<li><a href="#sitestrunkwordpressorgpublic_htmlwpcontentpluginsphpunittestreporterreadmetxt">sites/trunk/wordpress.org/public_html/wp-content/plugins/phpunit-test-reporter/readme.txt</a></li>
<li><a href="#sitestrunkwordpressorgpublic_htmlwpcontentpluginsphpunittestreportersrcclasscontentmodelphp">sites/trunk/wordpress.org/public_html/wp-content/plugins/phpunit-test-reporter/src/class-content-model.php</a></li>
<li><a href="#sitestrunkwordpressorgpublic_htmlwpcontentpluginsphpunittestreportersrcclassdisplayphp">sites/trunk/wordpress.org/public_html/wp-content/plugins/phpunit-test-reporter/src/class-display.php</a></li>
<li><a href="#sitestrunkwordpressorgpublic_htmlwpcontentpluginsphpunittestreportersrcclassrestapiphp">sites/trunk/wordpress.org/public_html/wp-content/plugins/phpunit-test-reporter/src/class-restapi.php</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="sitestrunkwordpressorgpublic_htmlwpcontentpluginsphpunittestreporterpartsresultsetphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: sites/trunk/wordpress.org/public_html/wp-content/plugins/phpunit-test-reporter/parts/result-set.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- sites/trunk/wordpress.org/public_html/wp-content/plugins/phpunit-test-reporter/parts/result-set.php 2017-12-13 05:12:43 UTC (rev 6261)
+++ sites/trunk/wordpress.org/public_html/wp-content/plugins/phpunit-test-reporter/parts/result-set.php 2017-12-13 19:27:11 UTC (rev 6262)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -24,21 +24,21 @@
</span><span class="cx" style="display: block; padding: 0 10px"> <th colspan="<?php echo (int) $total_cols - 1; ?>"><?php echo wp_kses_post( apply_filters( 'the_title', $revision->post_title ) ); ?></th>
</span><span class="cx" style="display: block; padding: 0 10px"> </tr>
</span><span class="cx" style="display: block; padding: 0 10px"> <?php
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $query_args = array(
- 'posts_per_page' => 10,
- 'post_type' => 'result',
- 'post_parent' => $revision->ID,
- 'orderby' => 'post_title',
- 'order' => 'ASC',
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $query_args = array(
+ 'posts_per_page' => 10,
+ 'post_type' => 'result',
+ 'post_parent' => $revision->ID,
+ 'orderby' => 'post_title',
+ 'order' => 'ASC',
</ins><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px"> $report_query = new WP_Query( $query_args );
</span><span class="cx" style="display: block; padding: 0 10px"> if ( ! empty( $report_query->posts ) ) :
</span><span class="cx" style="display: block; padding: 0 10px"> foreach ( $report_query->posts as $report ) :
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $status = 'Errored';
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $status = 'Errored';
</ins><span class="cx" style="display: block; padding: 0 10px"> $status_title = 'No results found for test.';
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $results = get_post_meta( $report->ID, 'results', true );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $results = get_post_meta( $report->ID, 'results', true );
</ins><span class="cx" style="display: block; padding: 0 10px"> if ( isset( $results['failures'] ) ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $status = 0 === (int) $results['failures'] && 0 === (int) $results['errors'] ? 'Passed' : 'Failed';
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $status = 0 === (int) $results['failures'] && 0 === (int) $results['errors'] ? 'Passed' : 'Failed';
</ins><span class="cx" style="display: block; padding: 0 10px"> $status_title = (int) $results['tests'] . ' tests, ' . (int) $results['failures'] . ' failed, ' . (int) $results['errors'] . ' errors';
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> $host = 'Unknown';
</span></span></pre></div>
<a id="sitestrunkwordpressorgpublic_htmlwpcontentpluginsphpunittestreporterpartssingleresultphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: sites/trunk/wordpress.org/public_html/wp-content/plugins/phpunit-test-reporter/parts/single-result.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- sites/trunk/wordpress.org/public_html/wp-content/plugins/phpunit-test-reporter/parts/single-result.php 2017-12-13 05:12:43 UTC (rev 6261)
+++ sites/trunk/wordpress.org/public_html/wp-content/plugins/phpunit-test-reporter/parts/single-result.php 2017-12-13 19:27:11 UTC (rev 6262)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1,11 +1,11 @@
</span><span class="cx" style="display: block; padding: 0 10px"> <?php
</span><span class="cx" style="display: block; padding: 0 10px"> use PTR\Display;
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-$status = 'Errored';
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+$status = 'Errored';
</ins><span class="cx" style="display: block; padding: 0 10px"> $status_title = 'No results found for test.';
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-$results = get_post_meta( $report->ID, 'results', true );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+$results = get_post_meta( $report->ID, 'results', true );
</ins><span class="cx" style="display: block; padding: 0 10px"> if ( isset( $results['failures'] ) ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $status = 0 === (int) $results['failures'] && 0 === (int) $results['errors'] ? 'Passed' : 'Failed';
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $status = 0 === (int) $results['failures'] && 0 === (int) $results['errors'] ? 'Passed' : 'Failed';
</ins><span class="cx" style="display: block; padding: 0 10px"> $status_title = (int) $results['tests'] . ' tests, ' . (int) $results['failures'] . ' failed, ' . (int) $results['errors'] . ' errors';
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> $host = 'Unknown';
</span></span></pre></div>
<a id="sitestrunkwordpressorgpublic_htmlwpcontentpluginsphpunittestreporterreadmetxt"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: sites/trunk/wordpress.org/public_html/wp-content/plugins/phpunit-test-reporter/readme.txt</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- sites/trunk/wordpress.org/public_html/wp-content/plugins/phpunit-test-reporter/readme.txt 2017-12-13 05:12:43 UTC (rev 6261)
+++ sites/trunk/wordpress.org/public_html/wp-content/plugins/phpunit-test-reporter/readme.txt 2017-12-13 19:27:11 UTC (rev 6262)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -13,6 +13,8 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> Captures and displays test results from the PHPUnit Test Runner
</span><span class="cx" style="display: block; padding: 0 10px">
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+For more details, [please read through the project overview](https://make.wordpress.org/hosting/test-results-getting-started/).
+
</ins><span class="cx" style="display: block; padding: 0 10px"> == Changelog ==
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> = 0.1.0 (August 21st, 2017) =
</span></span></pre></div>
<a id="sitestrunkwordpressorgpublic_htmlwpcontentpluginsphpunittestreportersrcclasscontentmodelphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: sites/trunk/wordpress.org/public_html/wp-content/plugins/phpunit-test-reporter/src/class-content-model.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- sites/trunk/wordpress.org/public_html/wp-content/plugins/phpunit-test-reporter/src/class-content-model.php 2017-12-13 05:12:43 UTC (rev 6261)
+++ sites/trunk/wordpress.org/public_html/wp-content/plugins/phpunit-test-reporter/src/class-content-model.php 2017-12-13 19:27:11 UTC (rev 6262)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -9,20 +9,21 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @return null
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> public static function action_init_register_post_type() {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- register_post_type( 'result',
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ register_post_type(
+ 'result',
</ins><span class="cx" style="display: block; padding: 0 10px"> array(
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- 'labels' => array(
- 'name' => __( 'Test Results', 'ptr' ),
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ 'labels' => array(
+ 'name' => __( 'Test Results', 'ptr' ),
</ins><span class="cx" style="display: block; padding: 0 10px"> 'singular_name' => __( 'Test Result', 'ptr' ),
</span><span class="cx" style="display: block; padding: 0 10px"> ),
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- 'public' => true,
- 'has_archive' => false,
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ 'public' => true,
+ 'has_archive' => false,
</ins><span class="cx" style="display: block; padding: 0 10px"> 'show_in_rest' => true,
</span><span class="cx" style="display: block; padding: 0 10px"> 'hierarchical' => true,
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- 'rewrite' => array(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ 'rewrite' => array(
</ins><span class="cx" style="display: block; padding: 0 10px"> 'slug' => 'test-results',
</span><span class="cx" style="display: block; padding: 0 10px"> ),
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- 'supports' => array(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ 'supports' => array(
</ins><span class="cx" style="display: block; padding: 0 10px"> 'title',
</span><span class="cx" style="display: block; padding: 0 10px"> 'editor',
</span><span class="cx" style="display: block; padding: 0 10px"> 'author',
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -31,13 +32,13 @@
</span><span class="cx" style="display: block; padding: 0 10px"> ),
</span><span class="cx" style="display: block; padding: 0 10px"> 'map_meta_cap' => true,
</span><span class="cx" style="display: block; padding: 0 10px"> 'capabilities' => array(
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- 'edit_post' => 'edit_result',
- 'edit_posts' => 'edit_results',
- 'edit_others_posts' => 'edit_others_results',
- 'publish_posts' => 'publish_results',
- 'read_post' => 'read_result',
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ 'edit_post' => 'edit_result',
+ 'edit_posts' => 'edit_results',
+ 'edit_others_posts' => 'edit_others_results',
+ 'publish_posts' => 'publish_results',
+ 'read_post' => 'read_result',
</ins><span class="cx" style="display: block; padding: 0 10px"> 'read_private_posts' => 'read_private_results',
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- 'delete_post' => 'delete_result',
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ 'delete_post' => 'delete_result',
</ins><span class="cx" style="display: block; padding: 0 10px"> ),
</span><span class="cx" style="display: block; padding: 0 10px"> )
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -48,9 +49,11 @@
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> public static function action_init_register_role() {
</span><span class="cx" style="display: block; padding: 0 10px"> if ( ! get_role( 'test-reporter' ) ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- add_role( 'test-reporter', __( 'Test Reporter', 'ptr' ), array(
- 'read' => true,
- ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ add_role(
+ 'test-reporter', __( 'Test Reporter', 'ptr' ), array(
+ 'read' => true,
+ )
+ );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> $role = get_role( 'test-reporter' );
</span><span class="cx" style="display: block; padding: 0 10px"> if ( $role ) {
</span></span></pre></div>
<a id="sitestrunkwordpressorgpublic_htmlwpcontentpluginsphpunittestreportersrcclassdisplayphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: sites/trunk/wordpress.org/public_html/wp-content/plugins/phpunit-test-reporter/src/class-display.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- sites/trunk/wordpress.org/public_html/wp-content/plugins/phpunit-test-reporter/src/class-display.php 2017-12-13 05:12:43 UTC (rev 6261)
+++ sites/trunk/wordpress.org/public_html/wp-content/plugins/phpunit-test-reporter/src/class-display.php 2017-12-13 19:27:11 UTC (rev 6262)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -21,7 +21,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> || '_wp_page_template' !== $meta_key ) {
</span><span class="cx" style="display: block; padding: 0 10px"> return $check;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $template = 'page-templates/full-width.php';
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $template = 'page-templates/full-width.php';
</ins><span class="cx" style="display: block; padding: 0 10px"> $full_width = get_stylesheet_directory() . '/' . $template;
</span><span class="cx" style="display: block; padding: 0 10px"> if ( ! file_exists( $full_width ) ) {
</span><span class="cx" style="display: block; padding: 0 10px"> return $check;
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -66,15 +66,19 @@
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> if ( get_queried_object()->post_parent ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $content = ptr_get_template_part( 'single-result', array(
- 'report' => get_queried_object(),
- ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $content = ptr_get_template_part(
+ 'single-result', array(
+ 'report' => get_queried_object(),
+ )
+ );
</ins><span class="cx" style="display: block; padding: 0 10px"> } else {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $content = ptr_get_template_part( 'result-set', array(
- 'revisions' => array(
- get_queried_object(),
- ),
- ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $content = ptr_get_template_part(
+ 'result-set', array(
+ 'revisions' => array(
+ get_queried_object(),
+ ),
+ )
+ );
</ins><span class="cx" style="display: block; padding: 0 10px"> $content = '<p><a href="' . esc_url( home_url( 'test-results/' ) ) . '">← Test Results</a></p>' . PHP_EOL . PHP_EOL . $content;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -86,15 +90,15 @@
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> public static function render_results( $atts ) {
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $output = '';
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $output = '';
</ins><span class="cx" style="display: block; padding: 0 10px"> $query_args = array(
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- 'posts_per_page' => 5,
- 'post_type' => 'result',
- 'post_parent' => 0,
- 'orderby' => 'post_name',
- 'order' => 'DESC',
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ 'posts_per_page' => 5,
+ 'post_type' => 'result',
+ 'post_parent' => 0,
+ 'orderby' => 'post_name',
+ 'order' => 'DESC',
</ins><span class="cx" style="display: block; padding: 0 10px"> );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $paged = isset( $_GET['rpage'] ) ? (int) $_GET['rpage'] : 0;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $paged = isset( $_GET['rpage'] ) ? (int) $_GET['rpage'] : 0;
</ins><span class="cx" style="display: block; padding: 0 10px"> if ( $paged ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $query_args['paged'] = $paged;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -104,9 +108,11 @@
</span><span class="cx" style="display: block; padding: 0 10px"> return $output;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> $output .= self::get_display_css();
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $output .= ptr_get_template_part( 'result-set', array(
- 'revisions' => $rev_query->posts,
- ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $output .= ptr_get_template_part(
+ 'result-set', array(
+ 'revisions' => $rev_query->posts,
+ )
+ );
</ins><span class="cx" style="display: block; padding: 0 10px"> ob_start();
</span><span class="cx" style="display: block; padding: 0 10px"> self::pagination( $rev_query );
</span><span class="cx" style="display: block; padding: 0 10px"> $output .= ob_get_clean();
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -181,7 +187,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> public static function get_display_php_version( $report_id ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $php_version = 'Unknown';
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $env = get_post_meta( $report_id, 'env', true );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $env = get_post_meta( $report_id, 'env', true );
</ins><span class="cx" style="display: block; padding: 0 10px"> if ( ! empty( $env['php_version'] ) ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $php_version = 'PHP ' . $env['php_version'];
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -196,9 +202,9 @@
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> public static function get_display_mysql_version( $report_id ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $mysql_version = 'Unknown';
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $env = get_post_meta( $report_id, 'env', true );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $env = get_post_meta( $report_id, 'env', true );
</ins><span class="cx" style="display: block; padding: 0 10px"> if ( ! empty( $env['mysql_version'] ) ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $bits = explode( ',', $env['mysql_version'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $bits = explode( ',', $env['mysql_version'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> $mysql_version = $bits[0];
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> return $mysql_version;
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -212,7 +218,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> public static function get_display_extensions( $report_id ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $extensions = array();
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $env = get_post_meta( $report_id, 'env', true );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $env = get_post_meta( $report_id, 'env', true );
</ins><span class="cx" style="display: block; padding: 0 10px"> if ( ! empty( $env['php_modules'] ) ) {
</span><span class="cx" style="display: block; padding: 0 10px"> foreach ( $env['php_modules'] as $module => $version ) {
</span><span class="cx" style="display: block; padding: 0 10px"> if ( ! empty( $version ) ) {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -232,22 +238,22 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> private static function pagination( $query ) {
</span><span class="cx" style="display: block; padding: 0 10px"> global $wp;
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $bignum = 999999999;
- $base_link = add_query_arg( 'rpage', '%#%', home_url( trailingslashit( $wp->request ) ) );
- $max_num_pages = $query->max_num_pages;
- $current_page = max( 1, $query->get( 'paged' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $bignum = 999999999;
+ $base_link = add_query_arg( 'rpage', '%#%', home_url( trailingslashit( $wp->request ) ) );
+ $max_num_pages = $query->max_num_pages;
+ $current_page = max( 1, $query->get( 'paged' ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> $prev_page_label = '‹';
</span><span class="cx" style="display: block; padding: 0 10px"> $next_page_label = '›';
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $args = array(
- 'base' => $base_link,
- 'format' => '',
- 'current' => $current_page,
- 'total' => $max_num_pages,
- 'prev_text' => $prev_page_label,
- 'next_text' => $next_page_label,
- 'type' => 'array',
- 'end_size' => 1,
- 'mid_size' => 2,
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $args = array(
+ 'base' => $base_link,
+ 'format' => '',
+ 'current' => $current_page,
+ 'total' => $max_num_pages,
+ 'prev_text' => $prev_page_label,
+ 'next_text' => $next_page_label,
+ 'type' => 'array',
+ 'end_size' => 1,
+ 'mid_size' => 2,
</ins><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> if ( $max_num_pages <= 1 ) {
</span></span></pre></div>
<a id="sitestrunkwordpressorgpublic_htmlwpcontentpluginsphpunittestreportersrcclassrestapiphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: sites/trunk/wordpress.org/public_html/wp-content/plugins/phpunit-test-reporter/src/class-restapi.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- sites/trunk/wordpress.org/public_html/wp-content/plugins/phpunit-test-reporter/src/class-restapi.php 2017-12-13 05:12:43 UTC (rev 6261)
+++ sites/trunk/wordpress.org/public_html/wp-content/plugins/phpunit-test-reporter/src/class-restapi.php 2017-12-13 19:27:11 UTC (rev 6262)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -13,31 +13,31 @@
</span><span class="cx" style="display: block; padding: 0 10px"> public static function register_routes() {
</span><span class="cx" style="display: block; padding: 0 10px"> register_rest_route(
</span><span class="cx" style="display: block; padding: 0 10px"> 'wp-unit-test-api/v1', 'results', array(
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- 'methods' => 'POST',
- 'callback' => array( __CLASS__, 'add_results_callback' ),
- 'args' => array(
- 'commit' => array(
- 'required' => true,
- 'description' => 'The SVN commit changeset number.',
- 'type' => 'numeric',
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ 'methods' => 'POST',
+ 'callback' => array( __CLASS__, 'add_results_callback' ),
+ 'args' => array(
+ 'commit' => array(
+ 'required' => true,
+ 'description' => 'The SVN commit changeset number.',
+ 'type' => 'numeric',
</ins><span class="cx" style="display: block; padding: 0 10px"> 'validate_callback' => array( __CLASS__, 'validate_callback' ),
</span><span class="cx" style="display: block; padding: 0 10px"> ),
</span><span class="cx" style="display: block; padding: 0 10px"> 'results' => array(
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- 'required' => true,
- 'description' => 'phpunit results in JSON format.',
- 'type' => 'string',
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ 'required' => true,
+ 'description' => 'phpunit results in JSON format.',
+ 'type' => 'string',
</ins><span class="cx" style="display: block; padding: 0 10px"> 'validate_callback' => array( __CLASS__, 'validate_callback' ),
</span><span class="cx" style="display: block; padding: 0 10px"> ),
</span><span class="cx" style="display: block; padding: 0 10px"> 'message' => array(
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- 'required' => true,
- 'description' => 'The SVN commit message.',
- 'type' => 'string',
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ 'required' => true,
+ 'description' => 'The SVN commit message.',
+ 'type' => 'string',
</ins><span class="cx" style="display: block; padding: 0 10px"> 'validate_callback' => array( __CLASS__, 'validate_callback' ),
</span><span class="cx" style="display: block; padding: 0 10px"> ),
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- 'env' => array(
- 'required' => true,
- 'description' => 'JSON blob containing information about the environment.',
- 'type' => 'string',
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ 'env' => array(
+ 'required' => true,
+ 'description' => 'JSON blob containing information about the environment.',
+ 'type' => 'string',
</ins><span class="cx" style="display: block; padding: 0 10px"> 'validate_callback' => array( __CLASS__, 'validate_callback' ),
</span><span class="cx" style="display: block; padding: 0 10px"> ),
</span><span class="cx" style="display: block; padding: 0 10px"> ),
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -50,37 +50,47 @@
</span><span class="cx" style="display: block; padding: 0 10px"> switch ( $key ) {
</span><span class="cx" style="display: block; padding: 0 10px"> case 'commit':
</span><span class="cx" style="display: block; padding: 0 10px"> if ( ! is_numeric( $value ) ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- return new WP_Error( 'rest_invalid', __( 'Value must be numeric.', 'ptr' ), array(
- 'status' => 400,
- ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return new WP_Error(
+ 'rest_invalid', __( 'Value must be numeric.', 'ptr' ), array(
+ 'status' => 400,
+ )
+ );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> return true;
</span><span class="cx" style="display: block; padding: 0 10px"> case 'message':
</span><span class="cx" style="display: block; padding: 0 10px"> if ( empty( $value ) || ! is_string( $value ) ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- return new WP_Error( 'rest_invalid', __( 'Value must be a non-empty string.', 'ptr' ), array(
- 'status' => 400,
- ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return new WP_Error(
+ 'rest_invalid', __( 'Value must be a non-empty string.', 'ptr' ), array(
+ 'status' => 400,
+ )
+ );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> return true;
</span><span class="cx" style="display: block; padding: 0 10px"> case 'env':
</span><span class="cx" style="display: block; padding: 0 10px"> case 'results':
</span><span class="cx" style="display: block; padding: 0 10px"> if ( null === json_decode( $value ) ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- return new WP_Error( 'rest_invalid', __( 'Value must be encoded JSON.', 'ptr' ), array(
- 'status' => 400,
- ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return new WP_Error(
+ 'rest_invalid', __( 'Value must be encoded JSON.', 'ptr' ), array(
+ 'status' => 400,
+ )
+ );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> return true;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- return new WP_Error( 'rest_invalid', __( 'Invalid key specified.', 'ptr' ), array(
- 'status' => 400,
- ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return new WP_Error(
+ 'rest_invalid', __( 'Invalid key specified.', 'ptr' ), array(
+ 'status' => 400,
+ )
+ );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public static function permission() {
</span><span class="cx" style="display: block; padding: 0 10px"> if ( ! current_user_can( 'edit_results' ) ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- return new WP_Error( 'rest_unauthorized', __( 'Sorry, you are not allowed to create results.', 'ptr' ), array(
- 'status' => is_user_logged_in() ? 403 : 401,
- ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return new WP_Error(
+ 'rest_unauthorized', __( 'Sorry, you are not allowed to create results.', 'ptr' ), array(
+ 'status' => is_user_logged_in() ? 403 : 401,
+ )
+ );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> return true;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -93,21 +103,23 @@
</span><span class="cx" style="display: block; padding: 0 10px"> if ( $post ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $parent_id = $post->ID;
</span><span class="cx" style="display: block; padding: 0 10px"> } else {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $parent_id = wp_insert_post( array(
- 'post_title' => $parameters['message'],
- 'post_name' => $slug,
- 'post_status' => 'publish',
- 'post_type' => 'result',
- ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $parent_id = wp_insert_post(
+ array(
+ 'post_title' => $parameters['message'],
+ 'post_name' => $slug,
+ 'post_status' => 'publish',
+ 'post_type' => 'result',
+ )
+ );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $current_user = wp_get_current_user();
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $args = array(
</span><span class="cx" style="display: block; padding: 0 10px"> 'post_parent' => $parent_id,
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- 'post_type' => 'result',
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ 'post_type' => 'result',
</ins><span class="cx" style="display: block; padding: 0 10px"> 'numberposts' => 1,
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- 'author' => $current_user->ID,
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ 'author' => $current_user->ID,
</ins><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Check to see if the test result already exist.
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -116,12 +128,12 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $post_id = $results[0]->ID;
</span><span class="cx" style="display: block; padding: 0 10px"> } else {
</span><span class="cx" style="display: block; padding: 0 10px"> $results = array(
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- 'post_title' => $current_user->user_login . ' - ' . $slug,
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ 'post_title' => $current_user->user_login . ' - ' . $slug,
</ins><span class="cx" style="display: block; padding: 0 10px"> 'post_content' => '',
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- 'post_status' => 'publish',
- 'post_author' => $current_user->ID,
- 'post_type' => 'result',
- 'post_parent' => $parent_id,
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ 'post_status' => 'publish',
+ 'post_author' => $current_user->ID,
+ 'post_type' => 'result',
+ 'post_parent' => $parent_id,
</ins><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Store the results.
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -132,7 +144,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> return $post_id;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $env = isset( $parameters['env'] ) ? json_decode( $parameters['env'], true ) : array();
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $env = isset( $parameters['env'] ) ? json_decode( $parameters['env'], true ) : array();
</ins><span class="cx" style="display: block; padding: 0 10px"> $results = isset( $parameters['results'] ) ? json_decode( $parameters['results'], true ) : array();
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> update_post_meta( $post_id, 'env', $env );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -141,8 +153,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> // Create the response object.
</span><span class="cx" style="display: block; padding: 0 10px"> $response = new \WP_REST_Response(
</span><span class="cx" style="display: block; padding: 0 10px"> array(
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- 'id' => $post_id,
- 'link' => get_permalink( $post_id ),
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ 'id' => $post_id,
+ 'link' => get_permalink( $post_id ),
</ins><span class="cx" style="display: block; padding: 0 10px"> )
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span></span></pre>
</div>
</div>
</body>
</html>