diff --git a/src/main/edu/wisc/doit/RpcNetidClientSoap.php b/src/main/edu/wisc/doit/RpcNetidClientSoap.php index 85422d85ad4208e9e31b01eee28a8cd7f0fdae4a..0556dde78de69f800ae5306d154b1ae77ebda629 100644 --- a/src/main/edu/wisc/doit/RpcNetidClientSoap.php +++ b/src/main/edu/wisc/doit/RpcNetidClientSoap.php @@ -343,18 +343,13 @@ class RpcNetidClientSoap implements RpcNetidClient { $result = $this->getSoapClient()->ping([]); - if ( $result->result === 200 ) { - if ( isset( $result->version ) ) { - return $result->version; - } else { - throw new RpcNetidClientSoapException("version not returned by web service", - RpcNetidClientSoapException::UNEXPECTED_RESPONSE); - } + if ( isset( $result->version ) ) { + return $result->version; + } else { + throw new RpcNetidClientSoapException("version not returned by web service", + RpcNetidClientSoapException::UNEXPECTED_RESPONSE); } - throw new RpcNetidClientSoapException("Unexpected status code: {$result->result}", - RpcNetidClientSoapException::UNEXPECTED_STATUS_CODE ); - } /** diff --git a/src/test/RpcNetidClientSoapTest.php b/src/test/RpcNetidClientSoapTest.php index 060ef838306ce375eb9a32b90e0dfd75c8a13110..45332f013baf7b501be03d63d4822a93d6711ad9 100644 --- a/src/test/RpcNetidClientSoapTest.php +++ b/src/test/RpcNetidClientSoapTest.php @@ -667,7 +667,6 @@ class RpcNetidClientSoapTest extends PHPUnit_Framework_TestCase { */ function ping_200_returns_version() { $result = new stdClass(); - $result->result = 200; $result->version = "1.0"; $this->mockSoapClient->expects($this->any())->method('ping')->will($this->returnValue($result)); @@ -675,20 +674,6 @@ class RpcNetidClientSoapTest extends PHPUnit_Framework_TestCase { $this->assertEquals( "1.0", $client->ping() ); } - /** - * @test ping() throws exception if unexpected response code - * @expectedException \edu\wisc\doit\RpcNetidClientSoapException - * @expectedExceptionCode 100 - */ - function ping_500_throws() { - $result = new stdClass(); - $result->result = 500; - - $this->mockSoapClient->expects($this->any())->method('ping')->will($this->returnValue($result)); - $client = new RpcNetidClientSoap($this->mockSoapClient); - $client->ping(); - } - /** * @test throws exception if version is not supplied by web service * @expectedException \edu\wisc\doit\RpcNetidClientSoapException @@ -696,7 +681,6 @@ class RpcNetidClientSoapTest extends PHPUnit_Framework_TestCase { */ function ping_no_version_throws() { $result = new stdClass(); - $result->result = 200; $this->mockSoapClient->expects($this->any())->method('ping')->will($this->returnValue($result)); $client = new RpcNetidClientSoap($this->mockSoapClient); diff --git a/src/test/integration-tests/RpcNetidClientSoapIT.php b/src/test/integration-tests/RpcNetidClientSoapIT.php index b85a8856aad3c80f1b3c6215347836dcdafb9030..1870d443f1f7a71c1f647c62b21bd9c5bee0a9d9 100644 --- a/src/test/integration-tests/RpcNetidClientSoapIT.php +++ b/src/test/integration-tests/RpcNetidClientSoapIT.php @@ -259,5 +259,11 @@ class RpcNetidClientSoapIT extends PHPUnit_Framework_TestCase { $this->assertFalse( $result->getIsValid() ); $this->assertNotEmpty( $result->getReasons() ); } + + /** @test */ + public function ping_control() { + $result = self::$client->ping(); + $this->assertNotEmpty( $result ); + } }