Skip to content
This repository has been archived by the owner on Jan 31, 2020. It is now read-only.

Commit

Permalink
Merge branch 'master' of git://github.com/zendframework/zf2 into feat…
Browse files Browse the repository at this point in the history
…ure/console
  • Loading branch information
Thinkscape committed Jul 15, 2012
6 parents 41e78a5 + b1c3dd1 + f3d5365 + 88de986 + fb38487 + 7bfe758 commit 9b6e2d1
Show file tree
Hide file tree
Showing 13 changed files with 122 additions and 99 deletions.
2 changes: 1 addition & 1 deletion src/AutoDiscover.php
Expand Up @@ -471,7 +471,7 @@ protected function _addFunctionToWsdl($function, $wsdl, $port, $binding)
);
// Add the wrapper element part, which must be named 'parameters'
$args['parameters'] = array('element' => $wsdl->addElement($element));
} else if ($prototype->getReturnType() != "void") {
} elseif ($prototype->getReturnType() != "void") {
// RPC style: add the return value as a typed part
$args['return'] = array('type' => $wsdl->getType($this->_discoveryStrategy->getFunctionReturnType($function, $prototype)));
}
Expand Down
2 changes: 1 addition & 1 deletion src/Client.php
Expand Up @@ -956,7 +956,7 @@ public function _doRequest(Client\Common $client, $request, $location, $action,
{
// Perform request as is
if ($one_way === null) {
return call_user_func(array($client,'SoapClient::__doRequest'), $request, $location, $action, $version);
return call_user_func(array($client,'SoapClient::__doRequest'), $request, $location, $action, $version);
}
return call_user_func(array($client, 'SoapClient::__doRequest'), $request, $location, $action, $version, $one_way);
}
Expand Down
4 changes: 2 additions & 2 deletions src/Client/Common.php
Expand Up @@ -33,7 +33,7 @@ class Common extends \SoapClient
* @param string $wsdl
* @param array $options
*/
function __construct($doRequestCallback, $wsdl, $options)
public function __construct($doRequestCallback, $wsdl, $options)
{
$this->_doRequestCallback = $doRequestCallback;

Expand All @@ -51,7 +51,7 @@ function __construct($doRequestCallback, $wsdl, $options)
* @param int $one_way
* @return mixed
*/
function __doRequest($request, $location, $action, $version, $one_way = null)
public function __doRequest($request, $location, $action, $version, $one_way = null)
{
if ($one_way === null) {
return call_user_func($this->_doRequestCallback, $this, $request, $location, $action, $version);
Expand Down
2 changes: 1 addition & 1 deletion src/Client/Local.php
Expand Up @@ -41,7 +41,7 @@ class Local extends SOAPClient
* @param string $wsdl
* @param array $options
*/
function __construct(SOAPServer $server, $wsdl, $options = null)
public function __construct(SOAPServer $server, $wsdl, $options = null)
{
$this->_server = $server;

Expand Down
2 changes: 1 addition & 1 deletion src/Wsdl/ComplexTypeStrategy/ArrayOfTypeSequence.php
Expand Up @@ -43,7 +43,7 @@ public function addComplexType($type)
}

return $complexType;
} else if (($soapType = $this->scanRegisteredTypes($type)) !== null) {
} elseif (($soapType = $this->scanRegisteredTypes($type)) !== null) {
// Existing complex type
return $soapType;
} else {
Expand Down
14 changes: 7 additions & 7 deletions test/AutoDiscoverTest.php
Expand Up @@ -64,7 +64,7 @@ protected function assertValidWSDL(\DOMDocument $dom)
unlink($file);
}

function testSetClass()
public function testSetClass()
{
$scriptUri = 'http://localhost/my_script.php';

Expand Down Expand Up @@ -147,7 +147,7 @@ function testSetClass()
$this->assertValidWSDL($dom);
}

function testSetClassWithDifferentStyles()
public function testSetClassWithDifferentStyles()
{
$scriptUri = 'http://localhost/my_script.php';

Expand Down Expand Up @@ -301,7 +301,7 @@ function testSetClassWithDifferentStyles()
/**
* @group ZF-5072
*/
function testSetClassWithResponseReturnPartCompabilityMode()
public function testSetClassWithResponseReturnPartCompabilityMode()
{
$scriptUri = 'http://localhost/my_script.php';

Expand All @@ -318,7 +318,7 @@ function testSetClassWithResponseReturnPartCompabilityMode()
unlink(__DIR__.'/TestAsset/setclass.wsdl');
}

function testAddFunctionSimple()
public function testAddFunctionSimple()
{
$scriptUri = 'http://localhost/my_script.php';

Expand Down Expand Up @@ -355,7 +355,7 @@ function testAddFunctionSimple()
$this->assertValidWSDL($dom);
}

function testAddFunctionSimpleWithDifferentStyle()
public function testAddFunctionSimpleWithDifferentStyle()
{
$scriptUri = 'http://localhost/my_script.php';

Expand Down Expand Up @@ -401,7 +401,7 @@ function testAddFunctionSimpleWithDifferentStyle()
/**
* @group ZF-5072
*/
function testAddFunctionSimpleInReturnNameCompabilityMode()
public function testAddFunctionSimpleInReturnNameCompabilityMode()
{
$scriptUri = 'http://localhost/my_script.php';

Expand All @@ -418,7 +418,7 @@ function testAddFunctionSimpleInReturnNameCompabilityMode()
$this->assertValidWSDL($dom);
}

function testAddFunctionMultiple()
public function testAddFunctionMultiple()
{
$scriptUri = 'http://localhost/my_script.php';

Expand Down
40 changes: 20 additions & 20 deletions test/ServerTest.php
Expand Up @@ -124,7 +124,7 @@ public function testSoapVersion()
$this->assertEquals(SOAP_1_2, $server->getSoapVersion());
$server->setSoapVersion(SOAP_1_1);
$this->assertEquals(SOAP_1_1, $server->getSoapVersion());

$this->setExpectedException('Zend\Soap\Exception\InvalidArgumentException', 'Invalid soap version specified');
$server->setSoapVersion('bogus');
}
Expand All @@ -134,7 +134,7 @@ public function testValidateUrn()
$server = new Server();
$this->assertTrue($server->validateUrn('http://framework.zend.com/'));
$this->assertTrue($server->validateUrn('urn:soapHandler/GetOpt'));

$this->setExpectedException('Zend\Soap\Exception\InvalidArgumentException', 'Invalid URN');
$server->validateUrn('bogosity');
}
Expand All @@ -146,7 +146,7 @@ public function testSetActor()
$this->assertNull($server->getActor());
$server->setActor('http://framework.zend.com/');
$this->assertEquals('http://framework.zend.com/', $server->getActor());

$this->setExpectedException('Zend\Soap\Exception\InvalidArgumentException', 'Invalid URN');
$server->setActor('bogus');
}
Expand All @@ -167,7 +167,7 @@ public function testSetUri()
$this->assertNull($server->getUri());
$server->setUri('http://framework.zend.com/');
$this->assertEquals('http://framework.zend.com/', $server->getUri());

$this->setExpectedException('Zend\Soap\Exception\InvalidArgumentException', 'Invalid URN');
$server->setUri('bogus');
}
Expand All @@ -192,19 +192,19 @@ public function testSetClassmap()
$server->setClassmap($classmap);
$this->assertTrue($classmap == $server->getClassmap());
}

public function testSetClassmapThrowsExceptionOnBogusStringParameter()
{
$server = new Server();

$this->setExpectedException('Zend\Soap\Exception\InvalidArgumentException', 'Classmap must be an array');
$server->setClassmap('bogus');
}

public function testSetClassmapThrowsExceptionOnBogusArrayParameter()
{
$server = new Server();

$this->setExpectedException('Zend\Soap\Exception\InvalidArgumentException', 'Invalid class in class map');
$server->setClassmap(array('soapTypeName', 'bogusClassName'));
}
Expand All @@ -228,7 +228,7 @@ public function testSetWsdl()
$this->assertNull($server->getWSDL());
$server->setWSDL(__DIR__.'/_files/wsdl_example.wsdl');
$this->assertEquals(__DIR__.'/_files/wsdl_example.wsdl', $server->getWSDL());

//$this->setExpectedException('Zend\Soap\Exception\InvalidArgumentException', 'foo');
$server->setWSDL(__DIR__.'/_files/bogus.wsdl');
}
Expand Down Expand Up @@ -264,7 +264,7 @@ public function testAddFunction()
public function testAddBogusFunctionAsInteger()
{
$server = new Server();

$this->setExpectedException('Zend\Soap\Exception\InvalidArgumentException', 'Invalid function specified');
$server->addFunction(126);
}
Expand All @@ -280,7 +280,7 @@ public function testAddBogusFunctionsAsString()
public function testAddBogusFunctionsAsArray()
{
$server = new Server();

$functions = array('\ZendTest\Soap\TestAsset\TestFunc5',
'bogus_function',
'\ZendTest\Soap\TestAsset\TestFunc6');
Expand Down Expand Up @@ -324,10 +324,10 @@ public function testSetClassTwiceThrowsException()
{
$server = new Server();
$server->setClass('\ZendTest\Soap\TestAsset\ServerTestClass');

$this->setExpectedException(
'Zend\Soap\Exception\InvalidArgumentException',
'A class has already been registered with this soap server instance'
'Zend\Soap\Exception\InvalidArgumentException',
'A class has already been registered with this soap server instance'
);
$server->setClass('\ZendTest\Soap\TestAsset\ServerTestClass');
}
Expand Down Expand Up @@ -368,37 +368,37 @@ public function testSetObject()
$r = $server->setObject(new TestAsset\ServerTestClass());
$this->assertSame($server, $r);
}

/**
* @group ZF-4366
*/
public function testSetObjectThrowsExceptionWithBadInput1()
{
$server = new Server();

$this->setExpectedException('Zend\Soap\Exception\InvalidArgumentException', 'Invalid object argument (integer)');
$server->setObject(465);
}

/**
* @group ZF-4366
*/
public function testSetObjectThrowsExceptionWithBadInput2()
{
$server = new Server();

$this->setExpectedException('Zend\Soap\Exception\InvalidArgumentException', 'Invalid object argument (integer)');
$int = 1;
$server->setObject($int);
}

/**
* @group ZF-4366
*/
public function testSetObjectThrowsExceptionWithBadInput3()
{
$server = new Server();

//$this->setExpectedException('Zend\Soap\Exception\InvalidArgumentException', 'foo');
$server->setObject(new TestAsset\ServerTestClass());
}
Expand Down
2 changes: 1 addition & 1 deletion test/TestAsset/MyCalculatorService.php
Expand Up @@ -11,7 +11,7 @@
namespace ZendTest\Soap\TestAsset;

/**
* MyCalculatorService
* MyCalculatorService
*
* Class used in DocumentLiteralWrapperTest
*/
Expand Down
3 changes: 2 additions & 1 deletion test/TestAsset/WsdlTestClass.php
Expand Up @@ -13,7 +13,8 @@
/**
* Test Class
*/
class WsdlTestClass {
class WsdlTestClass
{
/**
* @var integer
*/
Expand Down

0 comments on commit 9b6e2d1

Please sign in to comment.