Changeset 48937 for trunk/tests/phpunit/tests/import/parser.php
- Timestamp:
- 09/02/2020 12:35:36 AM (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/import/parser.php
r47198 r48937 33 33 $result = $parser->parse( $file ); 34 34 $this->assertWPError( $result ); 35 $this->assert Equals( 'There was an error when reading this WXR file', $result->get_error_message() );35 $this->assertSame( 'There was an error when reading this WXR file', $result->get_error_message() ); 36 36 } 37 37 } … … 46 46 $result = $parser->parse( $file ); 47 47 $this->assertWPError( $result ); 48 $this->assert Equals( 'This does not appear to be a WXR file, missing/invalid WXR version number', $result->get_error_message() );48 $this->assertSame( 'This does not appear to be a WXR file, missing/invalid WXR version number', $result->get_error_message() ); 49 49 } 50 50 } … … 60 60 61 61 $this->assertTrue( is_array( $result ), $message ); 62 $this->assert Equals( 'http://localhost/', $result['base_url'], $message );62 $this->assertSame( 'http://localhost/', $result['base_url'], $message ); 63 63 $this->assertEquals( 64 64 array( … … 107 107 ); 108 108 109 $this->assert Equals( 2, count( $result['posts'] ), $message );110 $this->assert Equals( 19, count( $result['posts'][0] ), $message );111 $this->assert Equals( 18, count( $result['posts'][1] ), $message );109 $this->assertSame( 2, count( $result['posts'] ), $message ); 110 $this->assertSame( 19, count( $result['posts'][0] ), $message ); 111 $this->assertSame( 18, count( $result['posts'][1] ), $message ); 112 112 $this->assertEquals( 113 113 array( … … 131 131 $message 132 132 ); 133 $this->assert Equals(133 $this->assertSame( 134 134 array( 135 135 array( … … 153 153 154 154 $this->assertTrue( is_array( $result ), $message ); 155 $this->assert Equals( 'http://localhost/', $result['base_url'], $message );156 $this->assert Equals( $result['categories'][0]['category_nicename'], 'alpha', $message );157 $this->assert Equals( $result['categories'][0]['cat_name'], 'alpha', $message );158 $this->assert Equals( $result['categories'][0]['category_parent'], '', $message );159 $this->assert Equals( $result['categories'][0]['category_description'], 'The alpha category', $message );160 $this->assert Equals( $result['tags'][0]['tag_slug'], 'chicken', $message );161 $this->assert Equals( $result['tags'][0]['tag_name'], 'chicken', $message );162 163 $this->assert Equals( 6, count( $result['posts'] ), $message );164 $this->assert Equals( 19, count( $result['posts'][0] ), $message );165 $this->assert Equals( 18, count( $result['posts'][1] ), $message );155 $this->assertSame( 'http://localhost/', $result['base_url'], $message ); 156 $this->assertSame( $result['categories'][0]['category_nicename'], 'alpha', $message ); 157 $this->assertSame( $result['categories'][0]['cat_name'], 'alpha', $message ); 158 $this->assertSame( $result['categories'][0]['category_parent'], '', $message ); 159 $this->assertSame( $result['categories'][0]['category_description'], 'The alpha category', $message ); 160 $this->assertSame( $result['tags'][0]['tag_slug'], 'chicken', $message ); 161 $this->assertSame( $result['tags'][0]['tag_name'], 'chicken', $message ); 162 163 $this->assertSame( 6, count( $result['posts'] ), $message ); 164 $this->assertSame( 19, count( $result['posts'][0] ), $message ); 165 $this->assertSame( 18, count( $result['posts'][1] ), $message ); 166 166 167 167 $this->assertEquals( … … 219 219 ); 220 220 221 $this->assert Equals(221 $this->assertSame( 222 222 array( 223 223 array( … … 247 247 248 248 $post = $result['posts'][0]; 249 $this->assert Equals( 'Content with nested <![CDATA[ tags ]]> :)', $post['post_content'], $message );249 $this->assertSame( 'Content with nested <![CDATA[ tags ]]> :)', $post['post_content'], $message ); 250 250 foreach ( $post['postmeta'] as $meta ) { 251 251 switch ( $meta['key'] ) { … … 262 262 $this->fail( 'Unknown postmeta (' . $meta['key'] . ') was parsed out by' . $p ); 263 263 } 264 $this->assert Equals( $value, $meta['value'], $message );264 $this->assertSame( $value, $meta['value'], $message ); 265 265 } 266 266 } … … 278 278 279 279 $post = $result['posts'][0]; 280 $this->assert Equals( 'Content with nested <![CDATA[ tags ]]> :)', $post['post_content'] );280 $this->assertSame( 'Content with nested <![CDATA[ tags ]]> :)', $post['post_content'] ); 281 281 foreach ( $post['postmeta'] as $meta ) { 282 282 switch ( $meta['key'] ) { … … 293 293 $this->fail( 'Unknown postmeta (' . $meta['key'] . ') was parsed out by' . $p ); 294 294 } 295 $this->assert Equals( $value, $meta['value'] );295 $this->assertSame( $value, $meta['value'] ); 296 296 } 297 297 }
Note: See TracChangeset
for help on using the changeset viewer.