From f764d7381a4f2685bde285f29caa182beee840ff Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Sun, 20 Feb 2022 10:12:37 +0000 Subject: [PATCH] Docs: Fix typo in `TracTickets::isTracTicketClosed()` description. Follow-up to [761/tests], [762/tests], [891/tests]. See #54729. git-svn-id: https://develop.svn.wordpress.org/trunk@52779 602fd350-edb4-49c9-b593-d223f7449a82 --- tests/phpunit/includes/trac.php | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/tests/phpunit/includes/trac.php b/tests/phpunit/includes/trac.php index 84617fa661..b8f9b79256 100644 --- a/tests/phpunit/includes/trac.php +++ b/tests/phpunit/includes/trac.php @@ -9,9 +9,9 @@ class TracTickets { protected static $trac_ticket_cache = array(); /** - * Checks if track ticket #$ticket_id is resolved + * Checks if Trac ticket #$ticket_id is resolved. * - * @return bool|null true if the ticket is resolved, false if not resolved, null on error + * @return bool|null True if the ticket is resolved, false if not resolved, null on error. */ public static function isTracTicketClosed( $trac_url, $ticket_id ) { // phpcs:ignore WordPress.NamingConventions.ValidFunctionName.MethodNameInvalid if ( ! extension_loaded( 'openssl' ) ) { @@ -22,6 +22,7 @@ class TracTickets { // In case you're running the tests offline, keep track of open tickets. $file = DIR_TESTDATA . '/.trac-ticket-cache.' . str_replace( array( 'http://', 'https://', '/' ), array( '', '', '-' ), rtrim( $trac_url, '/' ) ); $tickets = @file_get_contents( $trac_url . '/query?status=%21closed&format=csv&col=id' ); + // Check if our HTTP request failed. if ( false === $tickets ) { if ( file_exists( $file ) ) { @@ -37,7 +38,9 @@ class TracTickets { $tickets = trim( $tickets ); file_put_contents( $file, $tickets ); } - $tickets = explode( "\r\n", $tickets ); + + $tickets = explode( "\r\n", $tickets ); + self::$trac_ticket_cache[ $trac_url ] = $tickets; }