- Timestamp:
- 03/04/2021 10:11:38 AM (4 years ago)
- Location:
- trunk/tests/phpunit/tests
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/formatting/SanitizeFileName.php
r48937 r50491 6 6 class Tests_Formatting_SanitizeFileName extends WP_UnitTestCase { 7 7 function test_munges_extensions() { 8 #r179908 // r17990 9 9 $file_name = sanitize_file_name( 'test.phtml.txt' ); 10 10 $this->assertSame( 'test.phtml_.txt', $file_name ); -
trunk/tests/phpunit/tests/image/editorGd.php
r50449 r50491 90 90 $resized = $gd_image_editor->multi_resize( $sizes_array ); 91 91 92 # First, check to see if returned array is as expected92 // First, check to see if returned array is as expected. 93 93 $expected_array = array( 94 94 array( … … 218 218 */ 219 219 array( 220 'width' => 9999, # Arbitrary High Value220 'width' => 9999, // Arbitrary high value. 221 221 'height' => 20, 222 222 'crop' => false, … … 229 229 array( 230 230 'width' => 45, 231 'height' => 9999, # Arbitrary High Value231 'height' => 9999, // Arbitrary high value. 232 232 'crop' => true, 233 233 ), … … 272 272 */ 273 273 array( 274 'width' => -9999, # Arbitrary Negative Value274 'width' => -9999, // Arbitrary negative value. 275 275 'height' => 70, 276 276 ), … … 282 282 array( 283 283 'width' => 200, 284 'height' => -9999, # Arbitrary Negative Value284 'height' => -9999, // Arbitrary negative value. 285 285 ), 286 286 ); -
trunk/tests/phpunit/tests/image/editorImagick.php
r50449 r50491 84 84 $resized = $imagick_image_editor->multi_resize( $sizes_array ); 85 85 86 # First, check to see if returned array is as expected86 // First, check to see if returned array is as expected. 87 87 $expected_array = array( 88 88 array( … … 212 212 */ 213 213 array( 214 'width' => 9999, # Arbitrary High Value214 'width' => 9999, // Arbitrary high value. 215 215 'height' => 20, 216 216 'crop' => false, … … 223 223 array( 224 224 'width' => 45, 225 'height' => 9999, # Arbitrary High Value225 'height' => 9999, // Arbitrary high value. 226 226 'crop' => true, 227 227 ), … … 266 266 */ 267 267 array( 268 'width' => -9999, # Arbitrary Negative Value268 'width' => -9999, // Arbitrary negative value. 269 269 'height' => 70, 270 270 ), … … 276 276 array( 277 277 'width' => 200, 278 'height' => -9999, # Arbitrary Negative Value278 'height' => -9999, // Arbitrary negative value. 279 279 ), 280 280 ); -
trunk/tests/phpunit/tests/rest-api/rest-themes-controller.php
r50284 r50491 1206 1206 1207 1207 /** 1208 * Test single theme 1208 * Test single theme. 1209 1209 * 1210 1210 * @ticket 50152 -
trunk/tests/phpunit/tests/sitemaps/functions.php
r48937 r50491 102 102 array( 'posts', 'page', 1, home_url( '/?sitemap=posts&sitemap-subtype=page&paged=1' ) ), 103 103 array( 'posts', 'page', 5, home_url( '/?sitemap=posts&sitemap-subtype=page&paged=5' ) ), 104 // post_type doesn't exist.104 // Post type doesn't exist. 105 105 array( 'posts', 'foo', 5, false ), 106 106 array( 'taxonomies', 'category', 1, home_url( '/?sitemap=taxonomies&sitemap-subtype=category&paged=1' ) ), 107 107 array( 'taxonomies', 'post_tag', 1, home_url( '/?sitemap=taxonomies&sitemap-subtype=post_tag&paged=1' ) ), 108 // Negative paged, gets converted to its absolute value. 108 109 array( 'taxonomies', 'post_tag', -1, home_url( '/?sitemap=taxonomies&sitemap-subtype=post_tag&paged=1' ) ), 109 // negative paged, gets converted to it's absolute value.110 110 array( 'users', '', 4, home_url( '/?sitemap=users&paged=4' ) ), 111 // users provider doesn't allow subtypes.111 // Users provider doesn't allow subtypes. 112 112 array( 'users', 'foo', 4, false ), 113 // provider doesn't exist.113 // Provider doesn't exist. 114 114 array( 'foo', '', 4, false ), 115 115 ); … … 117 117 118 118 /** 119 * Data provider for test_get_sitemap_url_pretty_permalinks 119 * Data provider for test_get_sitemap_url_pretty_permalinks. 120 120 * 121 121 * @return array[] { … … 134 134 array( 'posts', 'page', 1, home_url( '/wp-sitemap-posts-page-1.xml' ) ), 135 135 array( 'posts', 'page', 5, home_url( '/wp-sitemap-posts-page-5.xml' ) ), 136 // post_type doesn't exist.136 // Post type doesn't exist. 137 137 array( 'posts', 'foo', 5, false ), 138 138 array( 'taxonomies', 'category', 1, home_url( '/wp-sitemap-taxonomies-category-1.xml' ) ), 139 139 array( 'taxonomies', 'post_tag', 1, home_url( '/wp-sitemap-taxonomies-post_tag-1.xml' ) ), 140 // negative paged, gets converted to it's absolute value.140 // Negative paged, gets converted to its absolute value. 141 141 array( 'taxonomies', 'post_tag', -1, home_url( '/wp-sitemap-taxonomies-post_tag-1.xml' ) ), 142 142 array( 'users', '', 4, home_url( '/wp-sitemap-users-4.xml' ) ), 143 // users provider doesn't allow subtypes.143 // Users provider doesn't allow subtypes. 144 144 array( 'users', 'foo', 4, false ), 145 // provider doesn't exist.145 // Provider doesn't exist. 146 146 array( 'foo', '', 4, false ), 147 147 ); -
trunk/tests/phpunit/tests/user/capabilities.php
r50490 r50491 646 646 foreach ( self::$users as $role => $user ) { 647 647 648 # Test adding the cap directly to the user648 // Test adding the cap directly to the user. 649 649 $user->add_cap( 'do_not_allow' ); 650 650 $has_cap = $user->has_cap( 'do_not_allow' ); … … 652 652 $this->assertFalse( $has_cap, "User with the {$role} role should not have the do_not_allow capability" ); 653 653 654 # Test adding the cap via a filter654 // Test adding the cap via a filter. 655 655 add_filter( 'user_has_cap', array( $this, 'grant_do_not_allow' ), 10, 4 ); 656 656 $has_cap = $user->has_cap( 'do_not_allow' ); … … 663 663 } 664 664 665 # Test adding the cap to the user's role665 // Test adding the cap to the user's role. 666 666 $role_obj = get_role( $role ); 667 667 $role_obj->add_cap( 'do_not_allow' ); … … 677 677 */ 678 678 public function test_do_not_allow_is_denied_for_super_admins() { 679 # Test adding the cap directly to the user679 // Test adding the cap directly to the user. 680 680 self::$super_admin->add_cap( 'do_not_allow' ); 681 681 $has_cap = self::$super_admin->has_cap( 'do_not_allow' ); … … 683 683 $this->assertFalse( $has_cap, 'Super admins should not have the do_not_allow capability' ); 684 684 685 # Test adding the cap via a filter685 // Test adding the cap via a filter. 686 686 add_filter( 'user_has_cap', array( $this, 'grant_do_not_allow' ), 10, 4 ); 687 687 $has_cap = self::$super_admin->has_cap( 'do_not_allow' );
Note: See TracChangeset
for help on using the changeset viewer.