settings['ServerDefault'] = 1; } #[RunInSeparateProcess] #[PreserveGlobalState(false)] public function testProcessFormSet(): void { DatabaseInterface::$instance = $this->createDatabaseInterface(); $responseStub = new ResponseRendererStub(); (new ReflectionProperty(ResponseRenderer::class, 'instance'))->setValue(null, $responseStub); // case 1 $formDisplay = $this->getMockBuilder(FormDisplay::class) ->disableOriginalConstructor() ->onlyMethods(['process', 'getDisplay']) ->getMock(); $formDisplay->expects($this->once()) ->method('process') ->with(false) ->willReturn(false); $formDisplay->expects($this->once()) ->method('getDisplay'); FormProcessing::process($formDisplay); // case 2 $formDisplay = $this->getMockBuilder(FormDisplay::class) ->disableOriginalConstructor() ->onlyMethods(['process', 'hasErrors', 'displayErrors']) ->getMock(); $formDisplay->expects($this->once()) ->method('process') ->with(false) ->willReturn(true); $formDisplay->expects($this->once()) ->method('hasErrors') ->with() ->willReturn(true); ob_start(); FormProcessing::process($formDisplay); $result = ob_get_clean(); $this->assertIsString($result); $this->assertStringContainsString('