Added SoapClientBuilder::withCompression()
This commit is contained in:
parent
d6c9074c94
commit
004d88f564
@ -77,6 +77,16 @@ class SoapClientBuilder extends AbstractSoapBuilder
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function withCompressionGzip()
|
||||
{
|
||||
$this->soapOptions['compression'] = SOAP_COMPRESSION_ACCEPT | SOAP_COMPRESSION_GZIP;
|
||||
}
|
||||
|
||||
public function withCompressionDeflate()
|
||||
{
|
||||
$this->soapOptions['compression'] = SOAP_COMPRESSION_ACCEPT | SOAP_COMPRESSION_DEFLATE;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return SoapClientBuilder
|
||||
*/
|
||||
|
@ -62,6 +62,17 @@ class SoapClientBuilderTest extends \PHPUnit_Framework_TestCase
|
||||
$this->assertEquals($this->mergeOptions(array('user_agent' => 'BeSimpleSoap Test')), $builder->getSoapOptions());
|
||||
}
|
||||
|
||||
public function testWithCompression()
|
||||
{
|
||||
$builder = $this->getSoapBuilder();
|
||||
|
||||
$builder->withCompressionGzip();
|
||||
$this->assertEquals($this->mergeOptions(array('compression' => SOAP_COMPRESSION_ACCEPT | SOAP_COMPRESSION_GZIP)), $builder->getSoapOptions());
|
||||
|
||||
$builder->withCompressionDeflate();
|
||||
$this->assertEquals($this->mergeOptions(array('compression' => SOAP_COMPRESSION_ACCEPT | SOAP_COMPRESSION_DEFLATE)), $builder->getSoapOptions());
|
||||
}
|
||||
|
||||
public function testWithAuthentication()
|
||||
{
|
||||
$builder = $this->getSoapBuilder();
|
||||
|
Loading…
Reference in New Issue
Block a user