mockResponse( [ ['status: 303 See Other'], ['Location: index.php?lang=en'], 303, ] ); // case 1 $formDisplay = $this->getMockBuilder('PhpMyAdmin\Config\FormDisplay') ->disableOriginalConstructor() ->setMethods(['process', 'getDisplay']) ->getMock(); $formDisplay->expects($this->once()) ->method('process') ->with(false) ->will($this->returnValue(false)); $formDisplay->expects($this->once()) ->method('getDisplay') ->with(true, true); FormProcessing::process($formDisplay); // case 2 $formDisplay = $this->getMockBuilder('PhpMyAdmin\Config\FormDisplay') ->disableOriginalConstructor() ->setMethods(['process', 'hasErrors', 'displayErrors']) ->getMock(); $formDisplay->expects($this->once()) ->method('process') ->with(false) ->will($this->returnValue(true)); $formDisplay->expects($this->once()) ->method('hasErrors') ->with() ->will($this->returnValue(true)); ob_start(); FormProcessing::process($formDisplay); $result = ob_get_clean(); $this->assertStringContainsString( '