diff --git a/tests/phpunit/tests/fonts/font-face/wpFontFace/generateAndPrint.php b/tests/phpunit/tests/fonts/font-face/wpFontFace/generateAndPrint.php index d10ea500e8707..a6454c11d1883 100644 --- a/tests/phpunit/tests/fonts/font-face/wpFontFace/generateAndPrint.php +++ b/tests/phpunit/tests/fonts/font-face/wpFontFace/generateAndPrint.php @@ -34,7 +34,7 @@ public function test_should_generate_and_print_given_fonts( array $fonts, $expec $style_element = "\n"; $expected_output = sprintf( $style_element, $expected ); - $this->expectOutputString( $expected_output ); - $font_face->generate_and_print( $fonts ); + $output = get_echo( array( $font_face, 'generate_and_print' ), array( $fonts ) ); + $this->assertEqualHTML( $expected_output, $output ); } } diff --git a/tests/phpunit/tests/fonts/font-face/wpPrintFontFaces.php b/tests/phpunit/tests/fonts/font-face/wpPrintFontFaces.php index 2fa64559c2049..71cd964ca1bd8 100644 --- a/tests/phpunit/tests/fonts/font-face/wpPrintFontFaces.php +++ b/tests/phpunit/tests/fonts/font-face/wpPrintFontFaces.php @@ -37,8 +37,8 @@ public function test_should_not_print_when_no_fonts() { public function test_should_print_given_fonts( array $fonts, $expected ) { $expected_output = $this->get_expected_styles_output( $expected ); - $this->expectOutputString( $expected_output ); - wp_print_font_faces( $fonts ); + $output = get_echo( 'wp_print_font_faces', array( $fonts ) ); + $this->assertEqualHTML( $expected_output, $output ); } public function test_should_escape_tags() { @@ -60,9 +60,9 @@ public function test_should_escape_tags() { CSS; - $this->expectOutputString( $expected_output ); - wp_print_font_faces( $fonts ); + $output = get_echo( 'wp_print_font_faces', array( $fonts ) ); + $this->assertEqualHTML( $expected_output, $output ); } public function test_should_print_fonts_in_merged_data() { @@ -71,8 +71,8 @@ public function test_should_print_fonts_in_merged_data() { $expected = $this->get_expected_fonts_for_fonts_block_theme( 'font_face_styles' ); $expected_output = $this->get_expected_styles_output( $expected ); - $this->expectOutputString( $expected_output ); - wp_print_font_faces(); + $output = get_echo( 'wp_print_font_faces' ); + $this->assertEqualHTML( $expected_output, $output ); } private function get_expected_styles_output( $styles ) { diff --git a/tests/phpunit/tests/fonts/font-face/wpPrintFontFacesFromStyleVariations.php b/tests/phpunit/tests/fonts/font-face/wpPrintFontFacesFromStyleVariations.php index a59ba882a4e86..5dd6304fd2f7b 100644 --- a/tests/phpunit/tests/fonts/font-face/wpPrintFontFacesFromStyleVariations.php +++ b/tests/phpunit/tests/fonts/font-face/wpPrintFontFacesFromStyleVariations.php @@ -43,8 +43,8 @@ public function test_should_print_fonts_in_style_variations() { $expected = $this->get_custom_style_variations( 'expected_styles' ); $expected_output = $this->get_expected_styles_output( $expected ); - $this->expectOutputString( $expected_output ); - wp_print_font_faces_from_style_variations(); + $output = get_echo( 'wp_print_font_faces_from_style_variations' ); + $this->assertEqualHTML( $expected_output, $output ); } private function get_expected_styles_output( $styles ) {