Changeset 48937 for trunk/tests/phpunit/tests/feed/atom.php
- Timestamp:
- 09/02/2020 12:35:36 AM (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/feed/atom.php
r48435 r48937 98 98 99 99 // Verify attributes. 100 $this->assert Equals( 'http://www.w3.org/2005/Atom', $atom[0]['attributes']['xmlns'] );101 $this->assert Equals( 'http://purl.org/syndication/thread/1.0', $atom[0]['attributes']['xmlns:thr'] );102 $this->assert Equals( site_url( '/wp-atom.php' ), $atom[0]['attributes']['xml:base'] );100 $this->assertSame( 'http://www.w3.org/2005/Atom', $atom[0]['attributes']['xmlns'] ); 101 $this->assertSame( 'http://purl.org/syndication/thread/1.0', $atom[0]['attributes']['xmlns:thr'] ); 102 $this->assertSame( site_url( '/wp-atom.php' ), $atom[0]['attributes']['xml:base'] ); 103 103 104 104 // Verify the <feed> element is present and contains a <title> child element. 105 105 $title = xml_find( $xml, 'feed', 'title' ); 106 $this->assert Equals( get_option( 'blogname' ), $title[0]['content'] );106 $this->assertSame( get_option( 'blogname' ), $title[0]['content'] ); 107 107 108 108 // Verify the <feed> element is present and contains a <updated> child element. 109 109 $updated = xml_find( $xml, 'feed', 'updated' ); 110 $this->assert Equals( strtotime( get_lastpostmodified() ), strtotime( $updated[0]['content'] ) );110 $this->assertSame( strtotime( get_lastpostmodified() ), strtotime( $updated[0]['content'] ) ); 111 111 112 112 // Verify the <feed> element is present and contains a <subtitle> child element. 113 113 $subtitle = xml_find( $xml, 'feed', 'subtitle' ); 114 $this->assert Equals( get_option( 'blogdescription' ), $subtitle[0]['content'] );114 $this->assertSame( get_option( 'blogdescription' ), $subtitle[0]['content'] ); 115 115 116 116 // Verify the <feed> element is present and contains two <link> child elements. … … 119 119 120 120 // Verify the <feed> element is present and contains a <link rel="alternate"> child element. 121 $this->assert Equals( 'alternate', $link[0]['attributes']['rel'] );122 $this->assert Equals( home_url(), $link[0]['attributes']['href'] );121 $this->assertSame( 'alternate', $link[0]['attributes']['rel'] ); 122 $this->assertSame( home_url(), $link[0]['attributes']['href'] ); 123 123 124 124 // Verify the <feed> element is present and contains a <link rel="href"> child element. 125 $this->assert Equals( 'self', $link[1]['attributes']['rel'] );126 $this->assert Equals( home_url( '/?feed=atom' ), $link[1]['attributes']['href'] );125 $this->assertSame( 'self', $link[1]['attributes']['rel'] ); 126 $this->assertSame( home_url( '/?feed=atom' ), $link[1]['attributes']['href'] ); 127 127 } 128 128 … … 155 155 $author = xml_find( $entries[ $key ]['child'], 'author', 'name' ); 156 156 $user = new WP_User( $post->post_author ); 157 $this->assert Equals( $user->display_name, $author[0]['content'] );157 $this->assertSame( $user->display_name, $author[0]['content'] ); 158 158 159 159 // Title. 160 160 $title = xml_find( $entries[ $key ]['child'], 'title' ); 161 $this->assert Equals( $post->post_title, $title[0]['content'] );161 $this->assertSame( $post->post_title, $title[0]['content'] ); 162 162 163 163 // Link rel="alternate". … … 165 165 foreach ( $link_alts as $link_alt ) { 166 166 if ( 'alternate' === $link_alt['attributes']['rel'] ) { 167 $this->assert Equals( get_permalink( $post ), $link_alt['attributes']['href'] );167 $this->assertSame( get_permalink( $post ), $link_alt['attributes']['href'] ); 168 168 } 169 169 } … … 171 171 // ID. 172 172 $guid = xml_find( $entries[ $key ]['child'], 'id' ); 173 $this->assert Equals( $post->guid, $id[0]['content'] );173 $this->assertSame( $post->guid, $id[0]['content'] ); 174 174 175 175 // Updated. 176 176 $updated = xml_find( $entries[ $key ]['child'], 'updated' ); 177 $this->assert Equals( strtotime( $post->post_modified_gmt ), strtotime( $updated[0]['content'] ) );177 $this->assertSame( strtotime( $post->post_modified_gmt ), strtotime( $updated[0]['content'] ) ); 178 178 179 179 // Published. 180 180 $published = xml_find( $entries[ $key ]['child'], 'published' ); 181 $this->assert Equals( strtotime( $post->post_date_gmt ), strtotime( $published[0]['content'] ) );181 $this->assertSame( strtotime( $post->post_date_gmt ), strtotime( $published[0]['content'] ) ); 182 182 183 183 // Category. … … 194 194 if ( ! $this->excerpt_only ) { 195 195 $content = xml_find( $entries[ $key ]['child'], 'content' ); 196 $this->assert Equals( trim( apply_filters( 'the_content', $post->post_content ) ), trim( $content[0]['content'] ) );196 $this->assertSame( trim( apply_filters( 'the_content', $post->post_content ) ), trim( $content[0]['content'] ) ); 197 197 } 198 198 … … 201 201 foreach ( $link_replies as $link_reply ) { 202 202 if ( 'replies' === $link_reply['attributes']['rel'] && 'application/atom+xml' === $link_reply['attributes']['type'] ) { 203 $this->assert Equals( get_post_comments_feed_link( $post->ID, 'atom' ), $link_reply['attributes']['href'] );203 $this->assertSame( get_post_comments_feed_link( $post->ID, 'atom' ), $link_reply['attributes']['href'] ); 204 204 } 205 205 } … … 274 274 foreach ( (array) $links as $link ) { 275 275 if ( 'enclosure' === $link['attributes']['rel'] ) { 276 $this->assert Equals( $enclosures[ $i ]['expected']['href'], $link['attributes']['href'] );276 $this->assertSame( $enclosures[ $i ]['expected']['href'], $link['attributes']['href'] ); 277 277 $this->assertEquals( $enclosures[ $i ]['expected']['length'], $link['attributes']['length'] ); 278 $this->assert Equals( $enclosures[ $i ]['expected']['type'], $link['attributes']['type'] );278 $this->assertSame( $enclosures[ $i ]['expected']['type'], $link['attributes']['type'] ); 279 279 $i++; 280 280 }
Note: See TracChangeset
for help on using the changeset viewer.