Changeset 35506 for trunk/tests/phpunit/tests/feed/rss2.php
- Timestamp:
- 11/04/2015 05:46:41 PM (10 years ago)
- File:
-
- 1 edited
-
trunk/tests/phpunit/tests/feed/rss2.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/feed/rss2.php
r35224 r35506 103 103 104 104 // get all the rss -> channel -> item elements 105 $items = xml_find($xml, 'rss', 'channel', 'item'); 106 $posts = get_posts('numberposts='.$this->post_count); 105 $items = xml_find( $xml, 'rss', 'channel', 'item' ); 107 106 108 107 // check each of the items against the known post data … … 179 178 } 180 179 } 180 181 /** 182 * @ticket 9134 183 */ 184 function test_items_comments_closed() { 185 add_filter( 'comments_open', '__return_false' ); 186 187 $this->go_to( '/?feed=rss2' ); 188 $feed = $this->do_rss2(); 189 $xml = xml_to_array($feed); 190 191 // get all the rss -> channel -> item elements 192 $items = xml_find( $xml, 'rss', 'channel', 'item' ); 193 194 // check each of the items against the known post data 195 foreach ( $items as $key => $item ) { 196 // Get post for comparison 197 $guid = xml_find( $items[$key]['child'], 'guid' ); 198 preg_match( '/\?p=(\d+)/', $guid[0]['content'], $matches ); 199 $post = get_post( $matches[1] ); 200 201 // comment link 202 $comments_link = xml_find( $items[ $key ]['child'], 'comments' ); 203 $this->assertEmpty( $comments_link ); 204 205 // comment rss 206 $comment_rss = xml_find( $items[ $key ]['child'], 'wfw:commentRss' ); 207 $this->assertEmpty( $comment_rss ); 208 } 209 210 remove_filter( 'comments_open', '__return_false' ); 211 } 181 212 }
Note: See TracChangeset
for help on using the changeset viewer.