public function testGetRedirectResponsePost() { $data = array('foo' => 'bar', 'key&"' => '<value>'); $this->response = m::mock('\\Omnipay\\Common\\Message\\AbstractResponseTest_MockRedirectResponse')->makePartial(); $this->response->shouldReceive('getRedirectMethod')->andReturn('POST'); $this->response->shouldReceive('getRedirectData')->andReturn($data); $httpResponse = $this->response->getRedirectResponse(); $this->assertSame(200, $httpResponse->getStatusCode()); $this->assertContains('<form action="https://example.com/redirect?a=1&b=2" method="post">', $httpResponse->getContent()); $this->assertContains('<input type="hidden" name="foo" value="bar" />', $httpResponse->getContent()); $this->assertContains('<input type="hidden" name="key&"" value="<value>" />', $httpResponse->getContent()); }