From 303deffe91c0b4065a1042d571f6e4758a012461 Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Tue, 22 Sep 2020 12:32:39 +0000 Subject: [PATCH] Tests: Use consistent trailing punctuation in `fail()` messages. See #51344. git-svn-id: https://develop.svn.wordpress.org/trunk@49033 602fd350-edb4-49c9-b593-d223f7449a82 --- tests/phpunit/tests/db.php | 2 +- tests/phpunit/tests/http/base.php | 2 +- tests/phpunit/tests/image/resize.php | 4 ++-- tests/phpunit/tests/import/parser.php | 4 ++-- tests/phpunit/tests/theme.php | 2 +- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/tests/phpunit/tests/db.php b/tests/phpunit/tests/db.php index d843f6bbd6..2ff9c65889 100644 --- a/tests/phpunit/tests/db.php +++ b/tests/phpunit/tests/db.php @@ -730,7 +730,7 @@ class Tests_DB extends WP_UnitTestCase { if ( count( $wpdb->get_results( 'SHOW CREATE PROCEDURE `test_mysqli_flush_sync_procedure`' ) ) < 1 ) { $wpdb->suppress_errors( $suppress ); - $this->fail( 'procedure could not be created (missing privileges?)' ); + $this->fail( 'Procedure could not be created (missing privileges?)' ); } $post_id = self::factory()->post->create(); diff --git a/tests/phpunit/tests/http/base.php b/tests/phpunit/tests/http/base.php index 4c489140ce..0919f91ac0 100644 --- a/tests/phpunit/tests/http/base.php +++ b/tests/phpunit/tests/http/base.php @@ -435,7 +435,7 @@ abstract class WP_HTTP_UnitTestCase extends WP_UnitTestCase { */ function test_ssl() { if ( ! wp_http_supports( array( 'ssl' ) ) ) { - $this->fail( 'This installation of PHP does not support SSL' ); + $this->fail( 'This installation of PHP does not support SSL.' ); } $res = wp_remote_get( 'https://wordpress.org/' ); diff --git a/tests/phpunit/tests/image/resize.php b/tests/phpunit/tests/image/resize.php index 05f9806bf5..e5f90858df 100644 --- a/tests/phpunit/tests/image/resize.php +++ b/tests/phpunit/tests/image/resize.php @@ -42,7 +42,7 @@ abstract class WP_Tests_Image_Resize_UnitTestCase extends WP_Image_UnitTestCase $image = $this->resize_helper( DIR_TESTDATA . '/images/test-image.png', 25, 25 ); if ( ! is_string( $image ) ) { // WP_Error, stop GLib-GObject-CRITICAL assertion. - $this->fail( sprintf( 'No PNG support in the editor engine %s on this system', $this->editor_engine ) ); + $this->fail( sprintf( 'No PNG support in the editor engine %s on this system.', $this->editor_engine ) ); } $this->assertSame( 'test-image-25x25.png', wp_basename( $image ) ); @@ -58,7 +58,7 @@ abstract class WP_Tests_Image_Resize_UnitTestCase extends WP_Image_UnitTestCase $image = $this->resize_helper( DIR_TESTDATA . '/images/test-image.gif', 25, 25 ); if ( ! is_string( $image ) ) { // WP_Error, stop GLib-GObject-CRITICAL assertion. - $this->fail( sprintf( 'No GIF support in the editor engine %s on this system', $this->editor_engine ) ); + $this->fail( sprintf( 'No GIF support in the editor engine %s on this system.', $this->editor_engine ) ); } $this->assertSame( 'test-image-25x25.gif', wp_basename( $image ) ); diff --git a/tests/phpunit/tests/import/parser.php b/tests/phpunit/tests/import/parser.php index 82214c110d..21c8c33c3f 100644 --- a/tests/phpunit/tests/import/parser.php +++ b/tests/phpunit/tests/import/parser.php @@ -259,7 +259,7 @@ class Tests_Import_Parser extends WP_Import_UnitTestCase { $value = 'This has closing '; break; default: - $this->fail( 'Unknown postmeta (' . $meta['key'] . ') was parsed out by' . $p ); + $this->fail( sprintf( 'Unknown postmeta (%1$s) was parsed out by %2$s.', $meta['key'], $p ) ); } $this->assertSame( $value, $meta['value'], $message ); } @@ -290,7 +290,7 @@ class Tests_Import_Parser extends WP_Import_UnitTestCase { $value = 'This has closing '; break; default: - $this->fail( 'Unknown postmeta (' . $meta['key'] . ') was parsed out by' . $p ); + $this->fail( sprintf( 'Unknown postmeta (%1$s) was parsed out by %2$s.', $meta['key'], $p ) ); } $this->assertSame( $value, $meta['value'] ); } diff --git a/tests/phpunit/tests/theme.php b/tests/phpunit/tests/theme.php index 50bb911cee..22110f352f 100644 --- a/tests/phpunit/tests/theme.php +++ b/tests/phpunit/tests/theme.php @@ -197,7 +197,7 @@ class Tests_Theme extends WP_UnitTestCase { function test_default_theme_in_default_theme_list() { $latest_default_theme = WP_Theme::get_core_default_theme(); if ( ! $latest_default_theme->exists() || 'twenty' !== substr( $latest_default_theme->get_stylesheet(), 0, 6 ) ) { - $this->fail( 'No Twenty* series default themes are installed' ); + $this->fail( 'No Twenty* series default themes are installed.' ); } $this->assertContains( $latest_default_theme->get_stylesheet(), $this->default_themes ); }