Esempio n. 1
0
/**
 * Function interceptor for call_user_func.
 *
 * @return mixed Return value.
 */
function call_user_func()
{
    if (!MockCallUserFunc::$mock) {
        return call_user_func_array('\\call_user_func', func_get_args());
    }
    MockCallUserFunc::$params = func_get_args();
    $result = '<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">' . '<s:Body>';
    $result .= '<TestMethodResponse xmlns="http://unit/test">' . '<TestMethodResult>' . '<TestMethodResult><dummy></dummy></TestMethodResult>' . '</TestMethodResult>' . '</TestMethodResponse>';
    $result .= '</s:Body>' . '</s:Envelope>';
    return $result;
}
Esempio n. 2
0
 /**
  * Tests that the default SOAP client request is done when not using NTLM authentication.
  *
  * @return void
  * @covers Zend\Soap\Client\DotNet::_doRequest
  */
 public function testDefaultSoapClientRequestIsDoneWhenNotUsingNtlmAuthentication()
 {
     $soapClient = $this->getMock('Zend\\Soap\\Client\\Common', array('_doRequest'), array(array($this->client, '_doRequest'), null, array('location' => 'http://unit/test', 'uri' => 'http://unit/test')));
     MockCallUserFunc::$mock = true;
     $this->client->setSoapClient($soapClient);
     $this->client->TestMethod();
     $this->assertSame('http://unit/test#TestMethod', MockCallUserFunc::$params[3]);
     MockCallUserFunc::$mock = false;
 }