diff --git a/tests/phpunit/tests/formatting/SanitizeFileName.php b/tests/phpunit/tests/formatting/SanitizeFileName.php index 39057aad06..c14803311d 100644 --- a/tests/phpunit/tests/formatting/SanitizeFileName.php +++ b/tests/phpunit/tests/formatting/SanitizeFileName.php @@ -5,7 +5,7 @@ */ class Tests_Formatting_SanitizeFileName extends WP_UnitTestCase { function test_munges_extensions() { - # r17990 + // r17990 $file_name = sanitize_file_name( 'test.phtml.txt' ); $this->assertSame( 'test.phtml_.txt', $file_name ); } diff --git a/tests/phpunit/tests/image/editorGd.php b/tests/phpunit/tests/image/editorGd.php index 2be19f93ef..d2523f4c6f 100644 --- a/tests/phpunit/tests/image/editorGd.php +++ b/tests/phpunit/tests/image/editorGd.php @@ -89,7 +89,7 @@ class Tests_Image_Editor_GD extends WP_Image_UnitTestCase { $resized = $gd_image_editor->multi_resize( $sizes_array ); - # First, check to see if returned array is as expected + // First, check to see if returned array is as expected. $expected_array = array( array( 'file' => 'waffles-50x33.jpg', @@ -217,7 +217,7 @@ class Tests_Image_Editor_GD extends WP_Image_UnitTestCase { * By aspect, should be 30x20 output. */ array( - 'width' => 9999, # Arbitrary High Value + 'width' => 9999, // Arbitrary high value. 'height' => 20, 'crop' => false, ), @@ -228,7 +228,7 @@ class Tests_Image_Editor_GD extends WP_Image_UnitTestCase { */ array( 'width' => 45, - 'height' => 9999, # Arbitrary High Value + 'height' => 9999, // Arbitrary high value. 'crop' => true, ), @@ -271,7 +271,7 @@ class Tests_Image_Editor_GD extends WP_Image_UnitTestCase { * By aspect, should be 105x70 output. */ array( - 'width' => -9999, # Arbitrary Negative Value + 'width' => -9999, // Arbitrary negative value. 'height' => 70, ), @@ -281,7 +281,7 @@ class Tests_Image_Editor_GD extends WP_Image_UnitTestCase { */ array( 'width' => 200, - 'height' => -9999, # Arbitrary Negative Value + 'height' => -9999, // Arbitrary negative value. ), ); diff --git a/tests/phpunit/tests/image/editorImagick.php b/tests/phpunit/tests/image/editorImagick.php index 2d956e44a3..dd3987a2cb 100644 --- a/tests/phpunit/tests/image/editorImagick.php +++ b/tests/phpunit/tests/image/editorImagick.php @@ -83,7 +83,7 @@ class Tests_Image_Editor_Imagick extends WP_Image_UnitTestCase { $resized = $imagick_image_editor->multi_resize( $sizes_array ); - # First, check to see if returned array is as expected + // First, check to see if returned array is as expected. $expected_array = array( array( 'file' => 'waffles-50x33.jpg', @@ -211,7 +211,7 @@ class Tests_Image_Editor_Imagick extends WP_Image_UnitTestCase { * By aspect, should be 30x20 output. */ array( - 'width' => 9999, # Arbitrary High Value + 'width' => 9999, // Arbitrary high value. 'height' => 20, 'crop' => false, ), @@ -222,7 +222,7 @@ class Tests_Image_Editor_Imagick extends WP_Image_UnitTestCase { */ array( 'width' => 45, - 'height' => 9999, # Arbitrary High Value + 'height' => 9999, // Arbitrary high value. 'crop' => true, ), @@ -265,7 +265,7 @@ class Tests_Image_Editor_Imagick extends WP_Image_UnitTestCase { * By aspect, should be 105x70 output. */ array( - 'width' => -9999, # Arbitrary Negative Value + 'width' => -9999, // Arbitrary negative value. 'height' => 70, ), @@ -275,7 +275,7 @@ class Tests_Image_Editor_Imagick extends WP_Image_UnitTestCase { */ array( 'width' => 200, - 'height' => -9999, # Arbitrary Negative Value + 'height' => -9999, // Arbitrary negative value. ), ); diff --git a/tests/phpunit/tests/rest-api/rest-themes-controller.php b/tests/phpunit/tests/rest-api/rest-themes-controller.php index 25265ca6fe..3e4d4103dd 100644 --- a/tests/phpunit/tests/rest-api/rest-themes-controller.php +++ b/tests/phpunit/tests/rest-api/rest-themes-controller.php @@ -1205,7 +1205,7 @@ class WP_Test_REST_Themes_Controller extends WP_Test_REST_Controller_Testcase { public function test_update_item() {} /** - * Test single theme + * Test single theme. * * @ticket 50152 */ diff --git a/tests/phpunit/tests/sitemaps/functions.php b/tests/phpunit/tests/sitemaps/functions.php index 2a2d0da204..aa4c63cc41 100644 --- a/tests/phpunit/tests/sitemaps/functions.php +++ b/tests/phpunit/tests/sitemaps/functions.php @@ -101,22 +101,22 @@ class Test_Sitemaps_Functions extends WP_UnitTestCase { array( 'posts', 'post', 0, home_url( '/?sitemap=posts&sitemap-subtype=post&paged=1' ) ), array( 'posts', 'page', 1, home_url( '/?sitemap=posts&sitemap-subtype=page&paged=1' ) ), array( 'posts', 'page', 5, home_url( '/?sitemap=posts&sitemap-subtype=page&paged=5' ) ), - // post_type doesn't exist. + // Post type doesn't exist. array( 'posts', 'foo', 5, false ), array( 'taxonomies', 'category', 1, home_url( '/?sitemap=taxonomies&sitemap-subtype=category&paged=1' ) ), array( 'taxonomies', 'post_tag', 1, home_url( '/?sitemap=taxonomies&sitemap-subtype=post_tag&paged=1' ) ), + // Negative paged, gets converted to its absolute value. array( 'taxonomies', 'post_tag', -1, home_url( '/?sitemap=taxonomies&sitemap-subtype=post_tag&paged=1' ) ), - // negative paged, gets converted to it's absolute value. array( 'users', '', 4, home_url( '/?sitemap=users&paged=4' ) ), - // users provider doesn't allow subtypes. + // Users provider doesn't allow subtypes. array( 'users', 'foo', 4, false ), - // provider doesn't exist. + // Provider doesn't exist. array( 'foo', '', 4, false ), ); } /** - * Data provider for test_get_sitemap_url_pretty_permalinks + * Data provider for test_get_sitemap_url_pretty_permalinks. * * @return array[] { * Data to test with. @@ -133,16 +133,16 @@ class Test_Sitemaps_Functions extends WP_UnitTestCase { array( 'posts', 'post', 0, home_url( '/wp-sitemap-posts-post-1.xml' ) ), array( 'posts', 'page', 1, home_url( '/wp-sitemap-posts-page-1.xml' ) ), array( 'posts', 'page', 5, home_url( '/wp-sitemap-posts-page-5.xml' ) ), - // post_type doesn't exist. + // Post type doesn't exist. array( 'posts', 'foo', 5, false ), array( 'taxonomies', 'category', 1, home_url( '/wp-sitemap-taxonomies-category-1.xml' ) ), array( 'taxonomies', 'post_tag', 1, home_url( '/wp-sitemap-taxonomies-post_tag-1.xml' ) ), - // negative paged, gets converted to it's absolute value. + // Negative paged, gets converted to its absolute value. array( 'taxonomies', 'post_tag', -1, home_url( '/wp-sitemap-taxonomies-post_tag-1.xml' ) ), array( 'users', '', 4, home_url( '/wp-sitemap-users-4.xml' ) ), - // users provider doesn't allow subtypes. + // Users provider doesn't allow subtypes. array( 'users', 'foo', 4, false ), - // provider doesn't exist. + // Provider doesn't exist. array( 'foo', '', 4, false ), ); } diff --git a/tests/phpunit/tests/user/capabilities.php b/tests/phpunit/tests/user/capabilities.php index 16d1168a43..9079ed413a 100644 --- a/tests/phpunit/tests/user/capabilities.php +++ b/tests/phpunit/tests/user/capabilities.php @@ -645,13 +645,13 @@ class Tests_User_Capabilities extends WP_UnitTestCase { public function test_do_not_allow_is_denied_for_all_roles() { foreach ( self::$users as $role => $user ) { - # Test adding the cap directly to the user + // Test adding the cap directly to the user. $user->add_cap( 'do_not_allow' ); $has_cap = $user->has_cap( 'do_not_allow' ); $user->remove_cap( 'do_not_allow' ); $this->assertFalse( $has_cap, "User with the {$role} role should not have the do_not_allow capability" ); - # Test adding the cap via a filter + // Test adding the cap via a filter. add_filter( 'user_has_cap', array( $this, 'grant_do_not_allow' ), 10, 4 ); $has_cap = $user->has_cap( 'do_not_allow' ); remove_filter( 'user_has_cap', array( $this, 'grant_do_not_allow' ), 10, 4 ); @@ -662,7 +662,7 @@ class Tests_User_Capabilities extends WP_UnitTestCase { continue; } - # Test adding the cap to the user's role + // Test adding the cap to the user's role. $role_obj = get_role( $role ); $role_obj->add_cap( 'do_not_allow' ); $has_cap = $user->has_cap( 'do_not_allow' ); @@ -676,13 +676,13 @@ class Tests_User_Capabilities extends WP_UnitTestCase { * @ticket 41059 */ public function test_do_not_allow_is_denied_for_super_admins() { - # Test adding the cap directly to the user + // Test adding the cap directly to the user. self::$super_admin->add_cap( 'do_not_allow' ); $has_cap = self::$super_admin->has_cap( 'do_not_allow' ); self::$super_admin->remove_cap( 'do_not_allow' ); $this->assertFalse( $has_cap, 'Super admins should not have the do_not_allow capability' ); - # Test adding the cap via a filter + // Test adding the cap via a filter. add_filter( 'user_has_cap', array( $this, 'grant_do_not_allow' ), 10, 4 ); $has_cap = self::$super_admin->has_cap( 'do_not_allow' ); remove_filter( 'user_has_cap', array( $this, 'grant_do_not_allow' ), 10, 4 );