Ticket #39265: L_folders-v2.patch
File L_folders-v2.patch, 20.1 KB (added by , 4 years ago) |
---|
-
tests/phpunit/tests/link/adminUrl.php
7 7 8 8 /** 9 9 * @ticket 37446 10 * 11 * @covers ::self_admin_url 10 12 */ 11 13 public function test_self_admin_url() { 12 14 $this->assertSame( admin_url(), self_admin_url() ); … … 14 16 15 17 /** 16 18 * @ticket 37446 19 * 20 * @covers ::self_admin_url 17 21 */ 18 22 public function test_self_admin_url_with_path() { 19 23 $path = 'options-general.php'; … … 23 27 24 28 /** 25 29 * @ticket 37446 30 * 31 * @covers ::self_admin_url 26 32 */ 27 33 public function test_self_admin_url_with_path_and_scheme() { 28 34 $path = 'options-general.php'; … … 33 39 34 40 /** 35 41 * @ticket 37446 42 * 43 * @covers ::self_admin_url 36 44 */ 37 45 public function test_self_admin_url_filtered() { 38 46 $path = 'options-general.php'; -
tests/phpunit/tests/link/getAdjacentPost.php
1 1 <?php 2 2 /** 3 3 * @group link 4 * @covers ::get_adjacent_post5 4 */ 6 5 class Tests_Link_GetAdjacentPost extends WP_UnitTestCase { 7 6 protected $exclude_term; … … 8 7 9 8 /** 10 9 * @ticket 17807 10 * 11 * @covers ::get_adjacent_post 11 12 */ 12 13 public function test_get_adjacent_post() { 13 14 // Need some sample posts to test adjacency. … … 88 89 89 90 /** 90 91 * @ticket 22112 92 * 93 * @covers ::get_adjacent_post 91 94 */ 92 95 function test_get_adjacent_post_exclude_self_term() { 93 96 // Bump term_taxonomy to mimic shared term offsets. … … 175 178 176 179 /** 177 180 * @ticket 32833 181 * 182 * @covers ::get_adjacent_post 178 183 */ 179 184 public function test_get_adjacent_post_excluded_terms() { 180 185 register_taxonomy( 'wptests_tax', 'post' ); … … 209 214 210 215 /** 211 216 * @ticket 32833 217 * 218 * @covers ::get_adjacent_post 212 219 */ 213 220 public function test_get_adjacent_post_excluded_terms_should_not_require_posts_to_have_terms_in_any_taxonomy() { 214 221 register_taxonomy( 'wptests_tax', 'post' ); … … 246 253 247 254 /** 248 255 * @ticket 35211 256 * 257 * @covers ::get_adjacent_post 249 258 */ 250 259 public function test_get_adjacent_post_excluded_terms_filter() { 251 260 register_taxonomy( 'wptests_tax', 'post' ); … … 280 289 281 290 /** 282 291 * @ticket 43521 292 * 293 * @covers ::get_adjacent_post 283 294 */ 284 295 public function test_get_adjacent_post_excluded_terms_filter_should_apply_to_empty_excluded_terms_parameter() { 285 296 register_taxonomy( 'wptests_tax', 'post' ); … … 314 325 315 326 /** 316 327 * @ticket 43521 328 * 329 * @covers ::get_adjacent_post 317 330 */ 318 331 public function test_excluded_terms_filter_empty() { 319 332 register_taxonomy( 'wptests_tax', 'post' ); -
tests/phpunit/tests/link/getAdjacentPostLink.php
53 53 $GLOBALS['post'] = get_post( $this->post_ids[2] ); 54 54 } 55 55 56 /** 57 * @covers ::get_next_post_link 58 */ 56 59 public function test_get_next_post_link_default() { 57 60 $actual = get_next_post_link(); 58 61 $title = get_post( $this->post_ids[1] )->post_title; … … 60 63 $this->assertSame( $expected, $actual ); 61 64 } 62 65 66 /** 67 * @covers ::get_previous_post_link 68 */ 63 69 public function test_get_previous_post_link_default() { 64 70 $actual = get_previous_post_link(); 65 71 $title = get_post( $this->post_ids[3] )->post_title; … … 67 73 $this->assertSame( $expected, $actual ); 68 74 } 69 75 76 /** 77 * @covers ::get_next_post_link 78 */ 70 79 public function test_get_next_post_link_same_category() { 71 80 $actual = get_next_post_link( '%link »', '%title', true ); 72 81 $title = get_post( $this->post_ids[1] )->post_title; … … 73 82 $expected = '<a href="' . home_url( '?p=' . $this->post_ids[1] ) . '" rel="next">' . $title . '</a> »'; 74 83 $this->assertSame( $expected, $actual ); 75 84 } 76 85 86 /** 87 * @covers ::get_previous_post_link 88 */ 77 89 public function test_get_previous_post_link_same_category() { 78 90 $actual = get_previous_post_link( '« %link', '%title', true ); 79 91 $title = get_post( $this->post_ids[3] )->post_title; … … 80 92 $expected = '« <a href="' . home_url( '?p=' . $this->post_ids[3] ) . '" rel="prev">' . $title . '</a>'; 81 93 $this->assertSame( $expected, $actual ); 82 94 } 83 95 96 /** 97 * @covers ::get_next_post_link 98 */ 84 99 public function test_get_next_post_link_exclude_category() { 85 100 $actual = get_next_post_link( '%link »', '%title', false, $this->cat_id ); 86 101 $title = get_post( $this->post_ids[1] )->post_title; … … 87 102 $expected = '<a href="' . home_url( '?p=' . $this->post_ids[1] ) . '" rel="next">' . $title . '</a> »'; 88 103 $this->assertSame( $expected, $actual ); 89 104 } 90 105 106 /** 107 * @covers ::get_previous_post_link 108 */ 91 109 public function test_get_previous_post_link_exclude_category() { 92 110 $actual = get_previous_post_link( '« %link', '%title', false, $this->cat_id ); 93 111 $title = get_post( $this->post_ids[3] )->post_title; -
tests/phpunit/tests/link/getDashboardUrl.php
20 20 21 21 /** 22 22 * @ticket 39065 23 * 24 * @covers ::get_dashboard_url 23 25 */ 24 26 public function test_get_dashboard_url_for_current_site_user() { 25 27 $this->assertSame( admin_url(), get_dashboard_url( self::$user_id ) ); … … 27 29 28 30 /** 29 31 * @ticket 39065 32 * 33 * @covers ::get_dashboard_url 30 34 */ 31 35 public function test_get_dashboard_url_for_user_with_no_sites() { 32 36 add_filter( 'get_blogs_of_user', '__return_empty_array' ); … … 39 43 /** 40 44 * @ticket 39065 41 45 * @group ms-required 46 * 47 * @covers ::get_dashboard_url 42 48 */ 43 49 public function test_get_dashboard_url_for_network_administrator_with_no_sites() { 44 50 grant_super_admin( self::$user_id ); … … 56 62 /** 57 63 * @ticket 39065 58 64 * @group ms-required 65 * 66 * @covers ::get_dashboard_url 59 67 */ 60 68 public function test_get_dashboard_url_for_administrator_of_different_site() { 61 69 $site_id = self::factory()->blog->create( array( 'user_id' => self::$user_id ) ); -
tests/phpunit/tests/link/getNextCommentsLink.php
3 3 /** 4 4 * @group link 5 5 * @group comment 6 * @covers ::get_next_comments_link7 6 */ 8 7 class Tests_Link_GetNextCommentsLink extends WP_UnitTestCase { 9 8 … … 23 22 24 23 /** 25 24 * @ticket 20319 25 * 26 * @covers ::get_next_comments_link 26 27 */ 27 28 public function test_page_should_default_to_1_when_no_cpage_query_var_is_found() { 28 29 $p = self::factory()->post->create(); -
tests/phpunit/tests/link/getPostCommentsFeedLink.php
4 4 */ 5 5 class Tests_Link_GetPostCommentsFeedLink extends WP_UnitTestCase { 6 6 7 /** 8 * @covers ::get_post_comments_feed_link 9 */ 7 10 public function test_post_link() { 8 11 $post_id = self::factory()->post->create(); 9 12 … … 19 22 $this->assertSame( $expected, $link ); 20 23 } 21 24 25 /** 26 * @covers ::get_post_comments_feed_link 27 */ 22 28 public function test_post_pretty_link() { 23 29 $this->set_permalink_structure( '/%year%/%monthnum%/%day%/%postname%/' ); 24 30 … … 30 36 $this->assertSame( $expected, $link ); 31 37 } 32 38 39 /** 40 * @covers ::get_post_comments_feed_link 41 */ 33 42 public function test_attachment_link() { 34 43 $post_id = self::factory()->post->create(); 35 44 $attachment_id = self::factory()->attachment->create_object( … … 53 62 $this->assertSame( $expected, $link ); 54 63 } 55 64 65 /** 66 * @covers ::get_post_comments_feed_link 67 */ 56 68 public function test_attachment_pretty_link() { 57 69 $this->set_permalink_structure( '/%year%/%monthnum%/%day%/%postname%/' ); 58 70 … … 79 91 $this->assertSame( $expected, $link ); 80 92 } 81 93 94 /** 95 * @covers ::get_post_comments_feed_link 96 */ 82 97 public function test_attachment_no_name_pretty_link() { 83 98 $this->set_permalink_structure( '/%year%/%monthnum%/%day%/%postname%/' ); 84 99 … … 98 113 $this->assertSame( $expected, $link ); 99 114 } 100 115 116 /** 117 * @covers ::get_post_comments_feed_link 118 */ 101 119 public function test_unattached_link() { 102 120 $attachment_id = self::factory()->attachment->create_object( 103 121 'image.jpg', … … 120 138 $this->assertSame( $expected, $link ); 121 139 } 122 140 141 /** 142 * @covers ::get_post_comments_feed_link 143 */ 123 144 public function test_unattached_pretty_link() { 124 145 $this->set_permalink_structure( '/%year%/%monthnum%/%day%/%postname%/' ); 125 146 -
tests/phpunit/tests/link/getPostTypeArchiveLink.php
6 6 7 7 /** 8 8 * @ticket 19902 9 * 10 * @covers get_post_type_archive_link 9 11 */ 10 12 public function test_get_post_archive_link_with_post_archive_on_front_page() { 11 13 update_option( 'show_on_front', 'posts' ); … … 16 18 17 19 /** 18 20 * @ticket 19902 21 * 22 * @covers get_post_type_archive_link 19 23 */ 20 24 public function test_get_post_archive_link_with_post_archive_on_a_blog_page() { 21 25 $page_for_posts = $this->factory->post->create( -
tests/phpunit/tests/link/getPreviewPostLink.php
1 1 <?php 2 2 /** 3 3 * @group link 4 * @covers ::get_preview_post_link5 4 */ 6 5 class Tests_Link_GetPreviewPostLink extends WP_UnitTestCase { 7 6 7 /** 8 * @covers ::get_preview_post_link 9 */ 8 10 public function test_get_preview_post_link() { 9 11 $post = self::factory()->post->create(); 10 12 … … 11 13 $this->assertSame( add_query_arg( 'preview', 'true', get_permalink( $post ) ), get_preview_post_link( $post ) ); 12 14 } 13 15 16 /** 17 * @covers ::get_preview_post_link 18 */ 14 19 public function test_get_preview_post_link_should_add_additional_query_vars() { 15 20 $post = self::factory()->post->create(); 16 21 … … 35 40 ); 36 41 } 37 42 43 /** 44 * @covers ::get_preview_post_link 45 */ 38 46 public function test_get_preview_post_link_should_use_custom_base_preview_link() { 39 47 $post = self::factory()->post->create(); 40 48 … … 53 61 ); 54 62 } 55 63 64 /** 65 * @covers ::get_preview_post_link 66 */ 56 67 public function test_get_preview_post_link_should_return_null_for_non_existent_post() { 57 68 $this->assertNull( get_preview_post_link() ); 58 69 $this->assertNull( get_preview_post_link( 9999 ) ); … … 59 70 $this->assertNull( get_preview_post_link( 'foo' ) ); 60 71 } 61 72 73 /** 74 * @covers ::get_preview_post_link 75 */ 62 76 public function test_get_preview_post_link_for_global_post() { 63 77 $post = self::factory()->post->create_and_get(); 64 78 … … 67 81 $this->assertSame( add_query_arg( 'preview', 'true', get_permalink( $post ) ), get_preview_post_link() ); 68 82 } 69 83 84 /** 85 * @covers ::get_preview_post_link 86 */ 70 87 public function test_get_preview_post_link_should_return_empty_string_for_non_viewable_post_type() { 71 88 $post_type = register_post_type( 72 89 'non_viewable_cpt', -
tests/phpunit/tests/link/getPreviousCommentsLink.php
3 3 /** 4 4 * @group link 5 5 * @group comment 6 * @covers ::get_previous_comments_link7 6 */ 8 7 class Tests_Link_GetPreviousCommentsLink extends WP_UnitTestCase { 9 8 … … 21 20 set_query_var( 'cpage', $cpage ); 22 21 } 23 22 23 /** 24 * @covers ::get_previous_comments_link 25 */ 24 26 public function test_page_should_default_to_1_when_no_cpage_query_var_is_found() { 25 27 $p = self::factory()->post->create(); 26 28 $this->go_to( get_permalink( $p ) ); -
tests/phpunit/tests/link/getThePrivacyPolicyLink.php
12 12 * 13 13 * @group link 14 14 * @group privacy 15 * @covers ::get_the_privacy_policy_link16 15 * 17 16 * @since 4.9.6 18 17 */ … … 73 72 * The function should return a valid link if a privacy policy page has been 74 73 * created and set as the `wp_page_for_privacy_policy`. The post title should 75 74 * be used as the link text. 75 * 76 * @covers ::get_the_privacy_policy_link 76 77 */ 77 78 public function test_get_the_privacy_policy_link_should_return_valid_link_when_privacy_page_set() { 78 79 update_option( 'wp_page_for_privacy_policy', self::$privacy_policy_page_id ); … … 87 88 /** 88 89 * The function should prepend the supplied `$before` markup and append the 89 90 * supplied `$after` markup when the `wp_page_for_privacy_policy` is configured. 91 * 92 * @covers ::get_the_privacy_policy_link 90 93 */ 91 94 public function test_get_the_privacy_policy_link_should_prepend_and_append_supplied_markup_when_privacy_page_set() { 92 95 update_option( 'wp_page_for_privacy_policy', self::$privacy_policy_page_id ); … … 101 104 /** 102 105 * The function should _not_ prepend the supplied `$before` markup and append 103 106 * the supplied `$after` markup when the `wp_page_for_privacy_policy` is _not_ configured. 107 * 108 * @covers ::get_the_privacy_policy_link 104 109 */ 105 110 public function test_get_the_privacy_policy_link_should_not_prepend_and_append_supplied_markup_when_privacy_page_not_set() { 106 111 $actual_link = get_the_privacy_policy_link( self::$before, self::$after ); … … 113 118 * for the privacy policy. 114 119 * 115 120 * @ticket 44192 121 * 122 * @covers ::get_the_privacy_policy_link 116 123 */ 117 124 public function test_function_should_return_empty_string_when_privacy_page_title_empty() { 118 125 $nameless_page_id = $this->factory->post->create( … … 129 136 130 137 /** 131 138 * The function should return an empty string when `wp_page_for_privacy_policy` is _not_ configured. 139 * 140 * @covers ::get_the_privacy_policy_link 132 141 */ 133 142 public function test_get_the_privacy_policy_link_should_return_empty_string_when_privacy_page_not_set() { 134 143 $this->assertSame( '', get_the_privacy_policy_link() ); … … 136 145 137 146 /** 138 147 * The output of the get_the_privacy_policy_link() function should be filterable with the 'privacy_policy_link' filter. 148 * 149 * @covers ::get_the_privacy_policy_link 139 150 */ 140 151 public function test_get_the_privacy_policy_link_should_be_filterable() { 141 152 update_option( 'wp_page_for_privacy_policy', self::$privacy_policy_page_id ); -
tests/phpunit/tests/link/themeFile.php
45 45 * @ticket 18302 46 46 * 47 47 * @dataProvider data_theme_files 48 * 49 * @covers ::get_theme_file_uri 50 * @covers ::get_parent_theme_file_uri 48 51 */ 49 52 public function test_theme_file_uri_with_parent_theme( $file, $expected_theme, $existence ) { 50 53 switch_theme( 'theme-file-parent' ); … … 58 61 * @ticket 18302 59 62 * 60 63 * @dataProvider data_theme_files 64 * 65 * @covers ::get_theme_file_uri 66 * @covers ::get_parent_theme_file_uri 61 67 */ 62 68 public function test_theme_file_uri_with_child_theme( $file, $expected_theme, $existence ) { 63 69 switch_theme( 'theme-file-child' ); … … 73 79 * @ticket 18302 74 80 * 75 81 * @dataProvider data_theme_files 82 * 83 * @covers ::get_theme_file_path 84 * @covers ::get_parent_theme_file_path 76 85 */ 77 86 public function test_theme_file_path_with_parent_theme( $file, $expected_theme, $existence ) { 78 87 switch_theme( 'theme-file-parent' ); … … 86 95 * @ticket 18302 87 96 * 88 97 * @dataProvider data_theme_files 98 * 99 * @covers ::get_theme_file_path 100 * @covers ::get_parent_theme_file_path 89 101 */ 90 102 public function test_theme_file_path_with_child_theme( $file, $expected_theme, $existence ) { 91 103 switch_theme( 'theme-file-child' ); … … 124 136 * @ticket 18302 125 137 * 126 138 * @dataProvider data_theme_files 139 * 140 * @covers ::get_theme_file_uri 141 * @covers ::get_parent_theme_file_uri 127 142 */ 128 143 public function test_theme_file_uri_returns_valid_uri( $file, $expected_theme, $existence ) { 129 144 $uri = get_theme_file_uri( $file ); -
tests/phpunit/tests/link/wpGetCanonicalURL.php
3 3 /** 4 4 * @group link 5 5 * @group canonical 6 * @covers ::wp_get_canonical_url7 6 */ 8 7 class Tests_WpGetCanonicalURL extends WP_UnitTestCase { 9 8 public static $post_id; … … 19 18 20 19 /** 21 20 * Test for a non existing post. 21 * 22 * @covers ::wp_get_canonical_url 22 23 */ 23 24 public function test_non_existing_post() { 24 25 $this->assertFalse( wp_get_canonical_url( -1 ) ); … … 26 27 27 28 /** 28 29 * Test for a post that is not published. 30 * 31 * @covers ::wp_get_canonical_url 29 32 */ 30 33 public function test_post_status() { 31 34 $post_id = self::factory()->post->create( … … 39 42 40 43 /** 41 44 * Test for a page that is not the queried object. 45 * 46 * @covers ::wp_get_canonical_url 42 47 */ 43 48 public function test_non_current_page() { 44 49 $this->assertSame( get_permalink( self::$post_id ), wp_get_canonical_url( self::$post_id ) ); … … 46 51 47 52 /** 48 53 * Test non permalink structure page usage. 54 * 55 * @covers ::wp_get_canonical_url 49 56 */ 50 57 public function test_paged_with_plain_permalink_structure() { 51 58 $link = add_query_arg( … … 70 77 71 78 /** 72 79 * Test permalink structure page usage. 80 * 81 * @covers ::wp_get_canonical_url 73 82 */ 74 83 public function test_paged_with_custom_permalink_structure() { 75 84 $this->set_permalink_structure( '/%postname%/' ); … … 91 100 } 92 101 93 102 /** 94 * Test non permalink structure comment page usage. 103 * Test non permalink structure comment page usage. 104 * 105 * @covers ::wp_get_canonical_url 95 106 */ 96 107 public function test_comments_paged_with_plain_permalink_structure() { 97 108 $cpage = 2; … … 118 129 119 130 /** 120 131 * Test permalink structure comment page usage. 132 * 133 * @covers ::wp_get_canonical_url 121 134 */ 122 135 public function test_comments_paged_with_pretty_permalink_structure() { 123 136 global $wp_rewrite; … … 142 155 143 156 /** 144 157 * Test calling of filter. 158 * 159 * @covers ::wp_get_canonical_url 145 160 */ 146 161 public function test_get_canonical_url_filter() { 147 162 add_filter( 'get_canonical_url', array( $this, 'canonical_url_filter' ) ); -
tests/phpunit/tests/load/convertHrToBytes.php
15 15 * 16 16 * @param int|string $value The value passed to wp_convert_hr_to_bytes(). 17 17 * @param int $expected The expected output of wp_convert_hr_to_bytes(). 18 * 19 * @covers ::wp_convert_hr_to_bytes 18 20 */ 19 21 function test_wp_convert_hr_to_bytes( $value, $expected ) { 20 22 $this->assertSame( $expected, wp_convert_hr_to_bytes( $value ) ); -
tests/phpunit/tests/load/isIniValueChangeable.php
16 16 * 17 17 * @param string $setting The setting passed to wp_is_ini_value_changeable(). 18 18 * @param bool $expected The expected output of wp_convert_hr_to_bytes(). 19 * 20 * @covers ::wp_is_ini_value_changeable 19 21 */ 20 22 function test_wp_is_ini_value_changeable( $setting, $expected ) { 21 23 $this->assertSame( $expected, wp_is_ini_value_changeable( $setting ) );