Added SoapHeader in SoapRequest

This commit is contained in:
Francis Besset
2011-09-04 23:42:03 +02:00
parent caeb484e19
commit 5790a89571
4 changed files with 104 additions and 5 deletions

View File

@ -23,6 +23,7 @@ class SoapClientTest extends \PHPUnit_Framework_TestCase
$options = array(
'cache_type' => Cache::TYPE_DISK_MEMORY,
'debug' => true,
'namespace' => 'foo',
);
$soapClient->setOptions($options);
@ -61,6 +62,25 @@ class SoapClientTest extends \PHPUnit_Framework_TestCase
$soapClient->getOption('bad_option');
}
public function testCreateSoapHeader()
{
$soapClient = new SoapClient('foo.wsdl', array('namespace' => 'http://foobar/soap/User/1.0/'));
$soapHeader = $soapClient->createSoapHeader('foo', 'bar');
$this->assertInstanceOf('SoapHeader', $soapHeader);
$this->assertEquals('http://foobar/soap/User/1.0/', $soapHeader->namespace);
$this->assertEquals('foo', $soapHeader->name);
$this->assertEquals('bar', $soapHeader->data);
}
public function testCreateSoapHeaderThrowsAnExceptionIfNamespaceIsNull()
{
$soapClient = new SoapClient('foo.wsdl');
$this->setExpectedException('RuntimeException');
$soapHeader = $soapClient->createSoapHeader('foo', 'bar');
}
public function testGetSoapOptions()
{
Cache::setType(Cache::TYPE_MEMORY);