public function testPayWithCustomUrl() { $this->mockHashService->expects($this->once())->method('makeRequestHash')->will($this->returnValue('3444cd767df689bcd5034ead29aa08a711111')); $this->mockRequest->expects($this->once())->method('setOrderHash'); $this->mockRequest->expects($this->once())->method('getRequestParams')->will($this->returnValue(array('HASH' => '3444cd767df689bcd5034ead29aa08a711111'))); $this->mockHTTPClient->expects($this->once())->method('post')->will($this->returnValue('<?xml version="1.0"?> <EPAYMENT> <REFNO>12022985</REFNO> <ALIAS/> <STATUS>FAILED</STATUS> <RETURN_CODE>ALREADY_AUTHORIZED</RETURN_CODE> <RETURN_MESSAGE>The payment for your order is already authorized.</RETURN_MESSAGE> <DATE>2014-09-22 11:08:23</DATE> <ORDER_REF>90003</ORDER_REF> <AUTH_CODE/> <RRN/> <HASH>1ef929de57a17b747c8b8569371f611e</HASH> </EPAYMENT>')); $this->mockHashService->expects($this->once())->method('validateResponseHash'); $this->client->setCustomUrl('http://www.example.com'); $this->assertInstanceOf('PayU\\Alu\\Response', $this->client->pay($this->mockRequest, $this->mockHTTPClient, $this->mockHashService)); }