Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ public function test_should_generate_and_print_given_fonts( array $fonts, $expec
$style_element = "<style class='wp-fonts-local' type='text/css'>\n%s\n</style>\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 );
}
}
12 changes: 6 additions & 6 deletions tests/phpunit/tests/fonts/font-face/wpPrintFontFaces.php
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand All @@ -60,9 +60,9 @@ public function test_should_escape_tags() {
</style>

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() {
Expand All @@ -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 ) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 ) {
Expand Down
Loading