Extended SoapServerBuilder with AbstractSoapBuilder of SoapCommon library

This commit is contained in:
Francis Besset
2011-10-09 19:35:08 +02:00
parent 3bb6d3abd4
commit cd2d8d90e8
3 changed files with 112 additions and 240 deletions

View File

@ -16,39 +16,30 @@ use BeSimple\SoapServer\SoapServerBuilder;
/**
* UnitTest for \BeSimple\SoapServer\SoapServerBuilder
*
*
* @author Christian Kerl
*/
class SoapServerBuilderTest extends \PHPUnit_Framework_TestCase
{
public function testUnconfiguredWsdl()
{
$builder = SoapServerBuilder::createEmpty();
try
{
$builder->build();
$this->fail('The SoapServer requires a WSDL file.');
}
catch(\InvalidArgumentException $e)
{
}
$builder = $this->getSoapServerBuilder();
$this->setExpectedException('InvalidArgumentException');
$builder->build();
}
public function testUnconfiguredHandler()
{
$builder = SoapServerBuilder::createEmpty();
$builder = $this->getSoapServerBuilder();
$builder->withWsdl('my.wsdl');
try
{
$builder->build();
$this->fail('The SoapServer requires a handler.');
}
catch(\InvalidArgumentException $e)
{
}
$this->setExpectedException('InvalidArgumentException');
$builder->build();
}
public function getSoapServerBuilder()
{
return new SoapServerBuilder();
}
}