diff --git a/plugins/optimization-detective/tests/test-optimization.php b/plugins/optimization-detective/tests/test-optimization.php index a1a621fac5..f212be8415 100644 --- a/plugins/optimization-detective/tests/test-optimization.php +++ b/plugins/optimization-detective/tests/test-optimization.php @@ -109,6 +109,8 @@ function ( $buffer ) use ( $template_override, $filter_override, &$filter_count ob_clean(); // Note the lack of flush here. echo $template_override; // This should get passed into the od_template_output_buffer filter. + ob_end_flush(); + $buffer = ob_get_clean(); // Get the buffer from our wrapper output buffer. $this->assertSame( 1, $filter_count, 'Expected filter to be called once.' );