l10n = $this->getMockBuilder(IL10N::class) ->disableOriginalConstructor()->getMock(); $this->l10n->expects($this->any()) ->method('t') ->willReturnCallback(function ($message, array $replace) { return vsprintf($message, $replace); }); } /* * output_buffer is PHP_INI_PERDIR and cannot changed at runtime. * Run this test with -d output_buffering=1 to validate the fail case. */ public function testPass(): void { $check = new PhpOutputBuffering($this->l10n); $this->assertEquals(SetupResult::SUCCESS, $check->run()->getSeverity()); } }