- Timestamp:
- 05/22/2024 03:39:51 PM (22 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/editor/navigation-fallback.php
r56971 r58183 46 46 $this->assertInstanceOf( 'WP_Post', $data, 'Response should be of the correct type.' ); 47 47 48 $this->assert Equals( 'wp_navigation', $data->post_type, 'Fallback menu type should be `wp_navigation`' );49 50 $this->assert Equals( 'Navigation', $data->post_title, 'Fallback menu title should be the default fallback title' );51 52 $this->assert Equals( 'navigation', $data->post_name, 'Fallback menu slug (post_name) should be the default slug' );53 54 $this->assert Equals( '<!-- wp:page-list /-->', $data->post_content );48 $this->assertSame( 'wp_navigation', $data->post_type, 'Fallback menu type should be `wp_navigation`' ); 49 50 $this->assertSame( 'Navigation', $data->post_title, 'Fallback menu title should be the default fallback title' ); 51 52 $this->assertSame( 'navigation', $data->post_name, 'Fallback menu slug (post_name) should be the default slug' ); 53 54 $this->assertSame( '<!-- wp:page-list /-->', $data->post_content ); 55 55 56 56 $navs_in_db = $this->get_navigations_in_database(); … … 93 93 $this->assertInstanceOf( 'WP_Post', $data, 'Response should be of the correct type.' ); 94 94 95 $this->assertNot Equals( '<!-- wp:page-list /-->', $data->post_content, 'Navigation Menu should not contain a Page List block.' );95 $this->assertNotSame( '<!-- wp:page-list /-->', $data->post_content, 'Navigation Menu should not contain a Page List block.' ); 96 96 97 97 $this->assertEmpty( $data->post_content, 'Menu should be empty.' ); … … 114 114 $this->assertInstanceOf( 'WP_Post', $data, 'Response should be of the correct type.' ); 115 115 116 $this->assert Equals( 'Navigation', $data->post_title, 'Fallback menu title should be the default title' );116 $this->assertSame( 'Navigation', $data->post_title, 'Fallback menu title should be the default title' ); 117 117 118 118 $navs_in_db = $this->get_navigations_in_database(); … … 147 147 $this->assertInstanceOf( 'WP_Post', $data, 'Response should be of the correct type.' ); 148 148 149 $this->assert Equals( $most_recently_published_nav->post_title, $data->post_title, 'Fallback menu title should be the same as the most recently created menu.' );150 151 $this->assert Equals( $most_recently_published_nav->post_name, $data->post_name, 'Post name should be the same as the most recently created menu.' );152 153 $this->assert Equals( $most_recently_published_nav->post_content, $data->post_content, 'Post content should be the same as the most recently created menu.' );149 $this->assertSame( $most_recently_published_nav->post_title, $data->post_title, 'Fallback menu title should be the same as the most recently created menu.' ); 150 151 $this->assertSame( $most_recently_published_nav->post_name, $data->post_name, 'Post name should be the same as the most recently created menu.' ); 152 153 $this->assertSame( $most_recently_published_nav->post_content, $data->post_content, 'Post content should be the same as the most recently created menu.' ); 154 154 155 155 // Check that no new Navigation menu was created. … … 180 180 $this->assertInstanceOf( 'WP_Post', $data, 'Response should be of the correct type.' ); 181 181 182 $this->assert Equals( 'Existing Classic Menu', $data->post_title, 'Fallback menu title should be the same as the classic menu.' );182 $this->assertSame( 'Existing Classic Menu', $data->post_title, 'Fallback menu title should be the same as the classic menu.' ); 183 183 184 184 // Assert that the fallback contains a navigation-link block. … … 234 234 $this->assertInstanceOf( 'WP_Post', $data, 'Response should be of the correct type.' ); 235 235 236 $this->assert Equals( 'Classic Menu in Primary Location', $data->post_title, 'Fallback menu title should match the menu in the "primary" location.' );236 $this->assertSame( 'Classic Menu in Primary Location', $data->post_title, 'Fallback menu title should match the menu in the "primary" location.' ); 237 237 } 238 238 … … 272 272 $this->assertInstanceOf( 'WP_Post', $data, 'Response should be of the correct type.' ); 273 273 274 $this->assert Equals( 'Primary', $data->post_title, 'Fallback menu title should match the menu with the slug "primary".' );274 $this->assertSame( 'Primary', $data->post_title, 'Fallback menu title should match the menu with the slug "primary".' ); 275 275 } 276 276 … … 310 310 $this->assertInstanceOf( 'WP_Post', $data, 'Response should be of the correct type.' ); 311 311 312 $this->assert Equals( 'Most Recent Classic Menu', $data->post_title, 'Fallback menu title should match the menu that was created most recently.' );312 $this->assertSame( 'Most Recent Classic Menu', $data->post_title, 'Fallback menu title should match the menu that was created most recently.' ); 313 313 } 314 314 … … 342 342 $this->assertInstanceOf( 'WP_Post', $data, 'Response should be of the correct type.' ); 343 343 344 $this->assert Equals( $existing_navigation_menu->post_title, $data->post_title, 'Fallback menu title should be the same as the existing Navigation menu.' );345 346 $this->assertNot Equals( 'Existing Classic Menu', $data->post_title, 'Fallback menu title should not be the same as the Classic Menu.' );344 $this->assertSame( $existing_navigation_menu->post_title, $data->post_title, 'Fallback menu title should be the same as the existing Navigation menu.' ); 345 346 $this->assertNotSame( 'Existing Classic Menu', $data->post_title, 'Fallback menu title should not be the same as the Classic Menu.' ); 347 347 348 348 // Check that only a single Navigation fallback was created.
Note: See TracChangeset
for help on using the changeset viewer.