Changeset 50370 for trunk/tests/phpunit/tests/robots.php
- Timestamp:
- 02/16/2021 11:36:44 PM (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/robots.php
r50284 r50370 177 177 } 178 178 179 /** 180 * @ticket 52457 181 */ 182 public function test_wp_robots_search_page() { 183 add_filter( 'wp_robots', 'wp_robots_noindex_search' ); 184 $this->go_to( home_url( '?s=ticket+52457+core.trac.wordpress.org' ) ); 185 186 $output = get_echo( 'wp_robots' ); 187 $this->assertContains( 'noindex', $output ); 188 } 189 190 /** 191 * @ticket 52457 192 */ 193 public function test_wp_robots_non_search_page() { 194 add_filter( 'wp_robots', 'wp_robots_noindex_search' ); 195 $this->go_to( home_url() ); 196 197 $output = get_echo( 'wp_robots' ); 198 $this->assertNotContains( 'noindex', $output ); 199 } 200 179 201 public function add_noindex_directive( array $robots ) { 180 202 $robots['noindex'] = true;
Note: See TracChangeset
for help on using the changeset viewer.