protected function getRequestMock()
{
if (!isset($this->requestMock)) {
$this->requestMock = $this->getMock('Symfony\\Component\\HttpFoundation\\Request');
$this->requestMock->attributes = $this->getRequestAttributesMock();
$this->requestMock->headers = $this->getRequestHeadersMock();
if ($this->requestMethod === false) {
$this->requestMock->expects($this->never())->method('getMethod');
} else {
$this->requestMock->expects($this->atLeastOnce())->method('getMethod')->will($this->returnValue($this->requestMethod));
}
}
return $this->requestMock;
}