From 310799a2680c453ca7860739ca35723971ff1fed Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Mon, 21 Sep 2020 14:05:23 +0000 Subject: [PATCH] Tests: Use consistent trailing punctuation in `markTestSkipped()` messages. See #51344. git-svn-id: https://develop.svn.wordpress.org/trunk@49027 602fd350-edb4-49c9-b593-d223f7449a82 --- tests/phpunit/tests/db.php | 6 ++-- tests/phpunit/tests/db/charset.php | 10 +++--- tests/phpunit/tests/functions.php | 2 +- tests/phpunit/tests/l10n/getLocale.php | 4 +-- tests/phpunit/tests/l10n/getUserLocale.php | 2 +- tests/phpunit/tests/multisite/siteMeta.php | 36 ++++++++++----------- tests/phpunit/tests/multisite/siteQuery.php | 2 +- tests/phpunit/tests/post.php | 2 +- 8 files changed, 32 insertions(+), 32 deletions(-) diff --git a/tests/phpunit/tests/db.php b/tests/phpunit/tests/db.php index c43de15141..d843f6bbd6 100644 --- a/tests/phpunit/tests/db.php +++ b/tests/phpunit/tests/db.php @@ -92,7 +92,7 @@ class Tests_DB extends WP_UnitTestCase { // Switch to a locale using comma as a decimal point separator. $flag = setlocale( LC_ALL, 'ru_RU.utf8', 'rus', 'fr_FR.utf8', 'fr_FR', 'de_DE.utf8', 'de_DE', 'es_ES.utf8', 'es_ES' ); if ( false === $flag ) { - $this->markTestSkipped( 'No European locales available for testing' ); + $this->markTestSkipped( 'No European locales available for testing.' ); } // Try an update query. @@ -716,7 +716,7 @@ class Tests_DB extends WP_UnitTestCase { function test_mysqli_flush_sync() { global $wpdb; if ( ! $wpdb->use_mysqli ) { - $this->markTestSkipped( 'mysqli not being used' ); + $this->markTestSkipped( 'mysqli not being used.' ); } $suppress = $wpdb->suppress_errors( true ); @@ -1048,7 +1048,7 @@ class Tests_DB extends WP_UnitTestCase { } if ( ! in_array( $expected_charset, array( 'utf8', 'utf8mb4', 'latin1' ), true ) ) { - $this->markTestSkipped( 'This test only works with utf8, utf8mb4 or latin1 character sets' ); + $this->markTestSkipped( 'This test only works with utf8, utf8mb4 or latin1 character sets.' ); } $data = array( 'post_content' => '¡foo foo foo!' ); diff --git a/tests/phpunit/tests/db/charset.php b/tests/phpunit/tests/db/charset.php index 7a7fc82353..3384b60e42 100644 --- a/tests/phpunit/tests/db/charset.php +++ b/tests/phpunit/tests/db/charset.php @@ -513,7 +513,7 @@ class Tests_DB_Charset extends WP_UnitTestCase { $charset = $wpdb->get_col_charset( $wpdb->posts, 'post_content' ); if ( 'utf8' !== $charset && 'utf8mb4' !== $charset ) { - $this->markTestSkipped( 'This test requires a utf8 character set' ); + $this->markTestSkipped( 'This test requires a utf8 character set.' ); } // \xf0\xff\xff\xff is invalid in utf8 and utf8mb4. @@ -640,7 +640,7 @@ class Tests_DB_Charset extends WP_UnitTestCase { $charset = $wpdb->get_col_charset( $wpdb->posts, 'post_content' ); if ( 'utf8' !== $charset && 'utf8mb4' !== $charset ) { - $this->markTestSkipped( 'This test requires a utf8 character set' ); + $this->markTestSkipped( 'This test requires a utf8 character set.' ); } // Invalid 3-byte and 4-byte sequences. @@ -946,7 +946,7 @@ class Tests_DB_Charset extends WP_UnitTestCase { $charset = $wpdb->get_col_charset( $wpdb->posts, 'post_content' ); if ( 'utf8' !== $charset && 'utf8mb4' !== $charset ) { - $this->markTestSkipped( 'This test requires a utf8 character set' ); + $this->markTestSkipped( 'This test requires a utf8 character set.' ); } $this->assertFalse( $wpdb->query( "INSERT INTO {$wpdb->posts} (post_content) VALUES ('foo\xf0\xff\xff\xffbar')" ) ); @@ -1045,7 +1045,7 @@ class Tests_DB_Charset extends WP_UnitTestCase { function test_strip_invalid_text_from_query_cp1251_is_safe() { $tablename = 'test_cp1251_query_' . rand_str( 5 ); if ( ! self::$_wpdb->query( "CREATE TABLE $tablename ( a VARCHAR(50) ) DEFAULT CHARSET 'cp1251'" ) ) { - $this->markTestSkipped( "Test requires the 'cp1251' charset" ); + $this->markTestSkipped( "Test requires the 'cp1251' charset." ); } $safe_query = "INSERT INTO $tablename( `a` ) VALUES( 'safe data' )"; @@ -1062,7 +1062,7 @@ class Tests_DB_Charset extends WP_UnitTestCase { function test_no_db_charset_defined() { $tablename = 'test_cp1251_query_' . rand_str( 5 ); if ( ! self::$_wpdb->query( "CREATE TABLE $tablename ( a VARCHAR(50) ) DEFAULT CHARSET 'cp1251'" ) ) { - $this->markTestSkipped( "Test requires the 'cp1251' charset" ); + $this->markTestSkipped( "Test requires the 'cp1251' charset." ); } $charset = self::$_wpdb->charset; diff --git a/tests/phpunit/tests/functions.php b/tests/phpunit/tests/functions.php index 7baf331662..9f68f22595 100644 --- a/tests/phpunit/tests/functions.php +++ b/tests/phpunit/tests/functions.php @@ -1081,7 +1081,7 @@ class Tests_Functions extends WP_UnitTestCase { */ function test_wp_raise_memory_limit() { if ( -1 !== WP_MAX_MEMORY_LIMIT ) { - $this->markTestSkipped( 'WP_MAX_MEMORY_LIMIT should be set to -1' ); + $this->markTestSkipped( 'WP_MAX_MEMORY_LIMIT should be set to -1.' ); } $ini_limit_before = ini_get( 'memory_limit' ); diff --git a/tests/phpunit/tests/l10n/getLocale.php b/tests/phpunit/tests/l10n/getLocale.php index f543e657e5..391ad08ed7 100644 --- a/tests/phpunit/tests/l10n/getLocale.php +++ b/tests/phpunit/tests/l10n/getLocale.php @@ -39,7 +39,7 @@ class Tests_L10n_GetLocale extends WP_UnitTestCase { */ public function test_network_option_should_be_fallback_on_multisite() { if ( ! is_multisite() ) { - $this->markTestSkipped( __METHOD__ . ' requires Multisite' ); + $this->markTestSkipped( __METHOD__ . ' requires Multisite.' ); } global $locale; @@ -59,7 +59,7 @@ class Tests_L10n_GetLocale extends WP_UnitTestCase { */ public function test_option_should_be_respected_on_nonmultisite() { if ( is_multisite() ) { - $this->markTestSkipped( __METHOD__ . ' does not apply to Multisite' ); + $this->markTestSkipped( __METHOD__ . ' does not apply to Multisite.' ); } global $locale; diff --git a/tests/phpunit/tests/l10n/getUserLocale.php b/tests/phpunit/tests/l10n/getUserLocale.php index 271bb3939f..0ecc69bf60 100644 --- a/tests/phpunit/tests/l10n/getUserLocale.php +++ b/tests/phpunit/tests/l10n/getUserLocale.php @@ -73,7 +73,7 @@ class Tests_Get_User_Locale extends WP_UnitTestCase { */ public function test_user_locale_is_same_across_network() { if ( ! is_multisite() ) { - $this->markTestSkipped( __METHOD__ . ' requires multisite' ); + $this->markTestSkipped( __METHOD__ . ' requires Multisite.' ); } $user_locale = get_user_locale(); diff --git a/tests/phpunit/tests/multisite/siteMeta.php b/tests/phpunit/tests/multisite/siteMeta.php index 8cdac5f946..e7625b09d9 100644 --- a/tests/phpunit/tests/multisite/siteMeta.php +++ b/tests/phpunit/tests/multisite/siteMeta.php @@ -58,7 +58,7 @@ if ( is_multisite() ) : public function test_add() { if ( ! is_site_meta_supported() ) { - $this->markTestSkipped( 'Tests only runs with the blogmeta database table installed' ); + $this->markTestSkipped( 'Test only runs with the blogmeta database table installed.' ); } $this->assertNotEmpty( add_site_meta( self::$site_id, 'foo', 'bar' ) ); @@ -67,7 +67,7 @@ if ( is_multisite() ) : public function test_add_unique() { if ( ! is_site_meta_supported() ) { - $this->markTestSkipped( 'Tests only runs with the blogmeta database table installed' ); + $this->markTestSkipped( 'Test only runs with the blogmeta database table installed.' ); } $this->assertNotEmpty( add_site_meta( self::$site_id, 'foo', 'bar' ) ); @@ -76,7 +76,7 @@ if ( is_multisite() ) : public function test_delete() { if ( ! is_site_meta_supported() ) { - $this->markTestSkipped( 'Tests only runs with the blogmeta database table installed' ); + $this->markTestSkipped( 'Test only runs with the blogmeta database table installed.' ); } add_site_meta( self::$site_id, 'foo', 'bar' ); @@ -87,7 +87,7 @@ if ( is_multisite() ) : public function test_delete_with_invalid_meta_key_should_return_false() { if ( ! is_site_meta_supported() ) { - $this->markTestSkipped( 'Tests only runs with the blogmeta database table installed' ); + $this->markTestSkipped( 'Test only runs with the blogmeta database table installed.' ); } $this->assertFalse( delete_site_meta( self::$site_id, 'foo' ) ); @@ -95,7 +95,7 @@ if ( is_multisite() ) : public function test_delete_should_respect_meta_value() { if ( ! is_site_meta_supported() ) { - $this->markTestSkipped( 'Tests only runs with the blogmeta database table installed' ); + $this->markTestSkipped( 'Test only runs with the blogmeta database table installed.' ); } add_site_meta( self::$site_id, 'foo', 'bar' ); @@ -109,7 +109,7 @@ if ( is_multisite() ) : public function test_get_with_no_key_should_fetch_all_keys() { if ( ! is_site_meta_supported() ) { - $this->markTestSkipped( 'Tests only runs with the blogmeta database table installed' ); + $this->markTestSkipped( 'Test only runs with the blogmeta database table installed.' ); } add_site_meta( self::$site_id, 'foo', 'bar' ); @@ -126,7 +126,7 @@ if ( is_multisite() ) : public function test_get_with_key_should_fetch_all_for_key() { if ( ! is_site_meta_supported() ) { - $this->markTestSkipped( 'Tests only runs with the blogmeta database table installed' ); + $this->markTestSkipped( 'Test only runs with the blogmeta database table installed.' ); } add_site_meta( self::$site_id, 'foo', 'bar' ); @@ -141,7 +141,7 @@ if ( is_multisite() ) : public function test_get_should_respect_single_true() { if ( ! is_site_meta_supported() ) { - $this->markTestSkipped( 'Tests only runs with the blogmeta database table installed' ); + $this->markTestSkipped( 'Test only runs with the blogmeta database table installed.' ); } add_site_meta( self::$site_id, 'foo', 'bar' ); @@ -153,7 +153,7 @@ if ( is_multisite() ) : public function test_update_should_pass_to_add_when_no_value_exists_for_key() { if ( ! is_site_meta_supported() ) { - $this->markTestSkipped( 'Tests only runs with the blogmeta database table installed' ); + $this->markTestSkipped( 'Test only runs with the blogmeta database table installed.' ); } $actual = update_site_meta( self::$site_id, 'foo', 'bar' ); @@ -166,7 +166,7 @@ if ( is_multisite() ) : public function test_update_should_return_true_when_updating_existing_value_for_key() { if ( ! is_site_meta_supported() ) { - $this->markTestSkipped( 'Tests only runs with the blogmeta database table installed' ); + $this->markTestSkipped( 'Tests only runs with the blogmeta database table installed.' ); } add_site_meta( self::$site_id, 'foo', 'bar' ); @@ -180,7 +180,7 @@ if ( is_multisite() ) : public function test_delete_by_key() { if ( ! is_site_meta_supported() ) { - $this->markTestSkipped( 'Tests only runs with the blogmeta database table installed' ); + $this->markTestSkipped( 'Tests only runs with the blogmeta database table installed.' ); } add_site_meta( self::$site_id, 'unique_delete_by_key', 'value', true ); @@ -197,7 +197,7 @@ if ( is_multisite() ) : public function test_site_meta_should_be_deleted_when_site_is_deleted() { if ( ! is_site_meta_supported() ) { - $this->markTestSkipped( 'Tests only runs with the blogmeta database table installed' ); + $this->markTestSkipped( 'Tests only runs with the blogmeta database table installed.' ); } $site_id = self::factory()->blog->create( @@ -223,7 +223,7 @@ if ( is_multisite() ) : global $wpdb; if ( ! is_site_meta_supported() ) { - $this->markTestSkipped( 'Tests only runs with the blogmeta database table installed' ); + $this->markTestSkipped( 'Tests only runs with the blogmeta database table installed.' ); } update_site_meta( self::$site_id, 'foo', 'bar' ); @@ -238,7 +238,7 @@ if ( is_multisite() ) : global $wpdb; if ( ! is_site_meta_supported() ) { - $this->markTestSkipped( 'Tests only runs with the blogmeta database table installed' ); + $this->markTestSkipped( 'Tests only runs with the blogmeta database table installed.' ); } update_site_meta( self::$site_id, 'foo', 'bar' ); @@ -259,7 +259,7 @@ if ( is_multisite() ) : global $wpdb; if ( ! is_site_meta_supported() ) { - $this->markTestSkipped( 'Tests only runs with the blogmeta database table installed' ); + $this->markTestSkipped( 'Tests only runs with the blogmeta database table installed.' ); } update_site_meta( self::$site_id, 'foo', 'bar' ); @@ -281,7 +281,7 @@ if ( is_multisite() ) : */ public function test_add_site_meta_should_bust_get_sites_cache() { if ( ! is_site_meta_supported() ) { - $this->markTestSkipped( 'Tests only runs with the blogmeta database table installed' ); + $this->markTestSkipped( 'Tests only runs with the blogmeta database table installed.' ); } add_site_meta( self::$site_id, 'foo', 'bar' ); @@ -323,7 +323,7 @@ if ( is_multisite() ) : */ public function test_update_site_meta_should_bust_get_sites_cache() { if ( ! is_site_meta_supported() ) { - $this->markTestSkipped( 'Tests only runs with the blogmeta database table installed' ); + $this->markTestSkipped( 'Tests only runs with the blogmeta database table installed.' ); } add_site_meta( self::$site_id, 'foo', 'bar' ); @@ -366,7 +366,7 @@ if ( is_multisite() ) : */ public function test_delete_site_meta_should_bust_get_sites_cache() { if ( ! is_site_meta_supported() ) { - $this->markTestSkipped( 'Tests only runs with the blogmeta database table installed' ); + $this->markTestSkipped( 'Tests only runs with the blogmeta database table installed.' ); } add_site_meta( self::$site_id, 'foo', 'bar' ); diff --git a/tests/phpunit/tests/multisite/siteQuery.php b/tests/phpunit/tests/multisite/siteQuery.php index 773a29164b..7d46519ac6 100644 --- a/tests/phpunit/tests/multisite/siteQuery.php +++ b/tests/phpunit/tests/multisite/siteQuery.php @@ -883,7 +883,7 @@ if ( is_multisite() ) : */ public function test_wp_site_query_meta_query( $query, $expected, $strict ) { if ( ! is_site_meta_supported() ) { - $this->markTestSkipped( 'Tests only runs with the blogmeta database table installed' ); + $this->markTestSkipped( 'Tests only runs with the blogmeta database table installed.' ); } add_site_meta( self::$site_ids['wordpress.org/'], 'foo', 'foo' ); diff --git a/tests/phpunit/tests/post.php b/tests/phpunit/tests/post.php index bacf9b23c5..b953683b4a 100644 --- a/tests/phpunit/tests/post.php +++ b/tests/phpunit/tests/post.php @@ -935,7 +935,7 @@ class Tests_Post extends WP_UnitTestCase { global $wpdb; if ( 'utf8' !== $wpdb->get_col_charset( $wpdb->posts, 'post_title' ) ) { - $this->markTestSkipped( 'This test is only useful with the utf8 character set' ); + $this->markTestSkipped( 'This test is only useful with the utf8 character set.' ); } require_once ABSPATH . '/wp-admin/includes/post.php';