Skip to content

Commit b1350b2

Browse files
committed
Use get_echo callback args
1 parent 36013ff commit b1350b2

File tree

2 files changed

+3
-15
lines changed

2 files changed

+3
-15
lines changed

tests/phpunit/tests/fonts/font-face/wpFontFace/generateAndPrint.php

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -34,11 +34,7 @@ public function test_should_generate_and_print_given_fonts( array $fonts, $expec
3434
$style_element = "<style class='wp-fonts-local' type='text/css'>\n%s\n</style>\n";
3535
$expected_output = sprintf( $style_element, $expected );
3636

37-
$output = get_echo(
38-
function () use ( $font_face, $fonts ) {
39-
$font_face->generate_and_print( $fonts );
40-
}
41-
);
37+
$output = get_echo( array( $font_face, 'generate_and_print' ), array( $fonts ) );
4238
$this->assertEqualHTML( $expected_output, $output );
4339
}
4440
}

tests/phpunit/tests/fonts/font-face/wpPrintFontFaces.php

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -37,11 +37,7 @@ public function test_should_not_print_when_no_fonts() {
3737
public function test_should_print_given_fonts( array $fonts, $expected ) {
3838
$expected_output = $this->get_expected_styles_output( $expected );
3939

40-
$output = get_echo(
41-
function () use ( $fonts ) {
42-
wp_print_font_faces( $fonts );
43-
}
44-
);
40+
$output = get_echo( 'wp_print_font_faces', array( $fonts ) );
4541
$this->assertEqualHTML( $expected_output, $output );
4642
}
4743

@@ -65,11 +61,7 @@ public function test_should_escape_tags() {
6561
6662
CSS;
6763

68-
$output = get_echo(
69-
function () use ( $fonts ) {
70-
wp_print_font_faces( $fonts );
71-
}
72-
);
64+
$output = get_echo( 'wp_print_font_faces', array( $fonts ) );
7365
$this->assertEqualHTML( $expected_output, $output );
7466
}
7567

0 commit comments

Comments
 (0)