[SoapRequest] Returns null if headers is empty
This commit is contained in:
parent
9cec9c65c4
commit
d29f0caa8d
|
@ -146,11 +146,11 @@ class SoapRequest
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return array
|
* @return array|null
|
||||||
*/
|
*/
|
||||||
public function getHeaders()
|
public function getHeaders()
|
||||||
{
|
{
|
||||||
return $this->headers;
|
return empty($this->headers) ? null : $this->headers;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -194,4 +194,4 @@ class SoapRequest
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -76,7 +76,7 @@ class SoapRequestTest extends \PHPUnit_Framework_TestCase
|
||||||
{
|
{
|
||||||
$soapRequest = new SoapRequest();
|
$soapRequest = new SoapRequest();
|
||||||
|
|
||||||
$this->assertEquals(array(), $soapRequest->getHeaders());
|
$this->assertEquals(null, $soapRequest->getHeaders());
|
||||||
|
|
||||||
$header1 = new \SoapHeader('foobar', 'foo', 'bar');
|
$header1 = new \SoapHeader('foobar', 'foo', 'bar');
|
||||||
$header2 = new \SoapHeader('barfoo', 'bar', 'foo');
|
$header2 = new \SoapHeader('barfoo', 'bar', 'foo');
|
||||||
|
@ -95,7 +95,7 @@ class SoapRequestTest extends \PHPUnit_Framework_TestCase
|
||||||
$this->assertNull($soapRequest->getFunction());
|
$this->assertNull($soapRequest->getFunction());
|
||||||
$this->assertEquals(array(), $soapRequest->getArguments());
|
$this->assertEquals(array(), $soapRequest->getArguments());
|
||||||
$this->assertEquals(array(), $soapRequest->getOptions());
|
$this->assertEquals(array(), $soapRequest->getOptions());
|
||||||
$this->assertEquals(array(), $soapRequest->getHeaders());
|
$this->assertEquals(null, $soapRequest->getHeaders());
|
||||||
|
|
||||||
$arguments = array('bar' => 'foobar');
|
$arguments = array('bar' => 'foobar');
|
||||||
$options = array('soapaction' => 'foobar');
|
$options = array('soapaction' => 'foobar');
|
||||||
|
@ -110,4 +110,4 @@ class SoapRequestTest extends \PHPUnit_Framework_TestCase
|
||||||
$this->assertEquals($options, $soapRequest->getOptions());
|
$this->assertEquals($options, $soapRequest->getOptions());
|
||||||
$this->assertSame($headers, $soapRequest->getHeaders());
|
$this->assertSame($headers, $soapRequest->getHeaders());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue