Changeset 51462 for trunk/tests/phpunit/tests/customize/manager.php
- Timestamp:
- 07/19/2021 02:00:11 PM (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/customize/manager.php
r51438 r51462 243 243 } 244 244 $this->assertInstanceOf( 'WPDieException', $exception ); 245 $this->assert Contains( 'you are not allowed to customize this site', $exception->getMessage() );245 $this->assertStringContainsString( 'you are not allowed to customize this site', $exception->getMessage() ); 246 246 247 247 // Bad changeset. … … 255 255 } 256 256 $this->assertInstanceOf( 'WPDieException', $exception ); 257 $this->assert Contains( 'Invalid changeset UUID', $exception->getMessage() );257 $this->assertStringContainsString( 'Invalid changeset UUID', $exception->getMessage() ); 258 258 259 259 update_option( 'fresh_site', '0' ); … … 312 312 } 313 313 $this->assertInstanceOf( 'WPDieException', $exception ); 314 $this->assert Contains( 'Non-existent changeset UUID', $exception->getMessage() );314 $this->assertStringContainsString( 'Non-existent changeset UUID', $exception->getMessage() ); 315 315 316 316 wp_set_current_user( self::$admin_user_id ); … … 718 718 $this->assertSame( 'waffles', get_post_meta( $posts_by_name['waffles'], '_customize_draft_post_name', true ) ); 719 719 $this->assertArrayHasKey( 'file', $attachment_metadata ); 720 $this->assert Contains( 'waffles', $attachment_metadata['file'] );720 $this->assertStringContainsString( 'waffles', $attachment_metadata['file'] ); 721 721 722 722 $this->assertSame( 'page', $changeset_values['show_on_front'] ); … … 799 799 $this->assertNotEmpty( get_header_image() ); 800 800 $this->assertNotEmpty( get_background_image() ); 801 $this->assert Contains( 'canola', get_custom_logo() );802 $this->assert Contains( 'waffles', get_header_image() );803 $this->assert Contains( 'waffles', get_background_image() );801 $this->assertStringContainsString( 'canola', get_custom_logo() ); 802 $this->assertStringContainsString( 'waffles', get_header_image() ); 803 $this->assertStringContainsString( 'waffles', get_background_image() ); 804 804 $this->assertSame( 'waffles', get_post( $posts_by_name['waffles'] )->post_name ); 805 805 $this->assertEmpty( get_post_meta( $posts_by_name['waffles'], '_customize_draft_post_name', true ) ); … … 921 921 } 922 922 $this->assertNotNull( $exception ); 923 $this->assert Contains( 'Unauthorized', $exception->getMessage() );923 $this->assertStringContainsString( 'Unauthorized', $exception->getMessage() ); 924 924 } 925 925 … … 1211 1211 $this->assertSame( 'trash', get_post_status( $post_id ) ); // Auto-trashed. 1212 1212 $this->assertSame( $original_capabilities, wp_list_pluck( $manager->settings(), 'capability' ) ); 1213 $this->assert Contains( '<script>', get_post( $post_id )->post_content );1213 $this->assertStringContainsString( '<script>', get_post( $post_id )->post_content ); 1214 1214 $this->assertSame( $manager->changeset_uuid(), get_post( $post_id )->post_name, 'Expected that the "__trashed" suffix to not be added.' ); 1215 1215 wp_set_current_user( self::$admin_user_id ); … … 1340 1340 1341 1341 // User saved as one who can bypass content_save_pre filter. 1342 $this->assert Contains( '<script>', get_option( 'custom_html_1' ) );1343 $this->assert Contains( 'Wordpress', get_option( 'custom_html_1' ) ); // phpcs:ignore WordPress.WP.CapitalPDangit.Misspelled1342 $this->assertStringContainsString( '<script>', get_option( 'custom_html_1' ) ); 1343 $this->assertStringContainsString( 'Wordpress', get_option( 'custom_html_1' ) ); // phpcs:ignore WordPress.WP.CapitalPDangit.Misspelled 1344 1344 1345 1345 // User saved as one who cannot bypass content_save_pre filter. 1346 $this->assert NotContains( '<script>', get_option( 'custom_html_2' ) );1347 $this->assert Contains( 'WordPress', get_option( 'custom_html_2' ) );1346 $this->assertStringNotContainsString( '<script>', get_option( 'custom_html_2' ) ); 1347 $this->assertStringContainsString( 'WordPress', get_option( 'custom_html_2' ) ); 1348 1348 1349 1349 // User saved as one who also cannot bypass content_save_pre filter. 1350 $this->assert NotContains( '<script>', get_option( 'custom_html_3' ) );1351 $this->assert Contains( 'WordPress', get_option( 'custom_html_3' ) );1350 $this->assertStringNotContainsString( '<script>', get_option( 'custom_html_3' ) ); 1351 $this->assertStringContainsString( 'WordPress', get_option( 'custom_html_3' ) ); 1352 1352 } 1353 1353 … … 1834 1834 ); 1835 1835 $this->assertFalse( wp_get_post_autosave( $changeset_post_id, get_current_user_id() ) ); 1836 $this->assert Contains( 'Autosaved Auto-draft Title', get_post( $changeset_post_id )->post_content );1836 $this->assertStringContainsString( 'Autosaved Auto-draft Title', get_post( $changeset_post_id )->post_content ); 1837 1837 1838 1838 // Update status to draft for subsequent tests. … … 1848 1848 ) 1849 1849 ); 1850 $this->assert Contains( 'Draft Title', get_post( $changeset_post_id )->post_content );1850 $this->assertStringContainsString( 'Draft Title', get_post( $changeset_post_id )->post_content ); 1851 1851 1852 1852 // Fail: illegal_autosave_with_date_gmt. … … 1895 1895 $autosave_revision = wp_get_post_autosave( $changeset_post_id, get_current_user_id() ); 1896 1896 $this->assertInstanceOf( 'WP_Post', $autosave_revision ); 1897 $this->assert Contains( 'Draft Title', get_post( $changeset_post_id )->post_content );1898 $this->assert Contains( 'Autosave Title', $autosave_revision->post_content );1897 $this->assertStringContainsString( 'Draft Title', get_post( $changeset_post_id )->post_content ); 1898 $this->assertStringContainsString( 'Autosave Title', $autosave_revision->post_content ); 1899 1899 } 1900 1900 … … 2941 2941 function test_get_document_title_template() { 2942 2942 $tpl = $this->manager->get_document_title_template(); 2943 $this->assert Contains( '%s', $tpl );2943 $this->assertStringContainsString( '%s', $tpl ); 2944 2944 } 2945 2945 … … 3080 3080 $content = ob_get_clean(); 3081 3081 3082 $this->assert Contains( 'var _wpCustomizeSettings =', $content );3083 $this->assert Contains( '"blogname"', $content );3084 $this->assert Contains( '"type":"option"', $content );3085 $this->assert Contains( '_wpCustomizeSettings.controls', $content );3086 $this->assert Contains( '_wpCustomizeSettings.settings', $content );3087 $this->assert Contains( '</script>', $content );3082 $this->assertStringContainsString( 'var _wpCustomizeSettings =', $content ); 3083 $this->assertStringContainsString( '"blogname"', $content ); 3084 $this->assertStringContainsString( '"type":"option"', $content ); 3085 $this->assertStringContainsString( '_wpCustomizeSettings.controls', $content ); 3086 $this->assertStringContainsString( '_wpCustomizeSettings.settings', $content ); 3087 $this->assertStringContainsString( '</script>', $content ); 3088 3088 3089 3089 $this->assertNotEmpty( preg_match( '#var _wpCustomizeSettings\s*=\s*({.*?});\s*\n#', $content, $matches ) ); … … 3132 3132 $manager->remove_frameless_preview_messenger_channel(); 3133 3133 $output = ob_get_clean(); 3134 $this->assert Contains( '<script>', $output );3134 $this->assertStringContainsString( '<script>', $output ); 3135 3135 } 3136 3136
Note: See TracChangeset
for help on using the changeset viewer.