diff --git a/src/main/edu/wisc/doit/RpcNetidClientSoap.php b/src/main/edu/wisc/doit/RpcNetidClientSoap.php index 1e21501d309384a303e51c247936342469858398..d3252419bb30fba6fb90fd3feb76f870c000ac8b 100644 --- a/src/main/edu/wisc/doit/RpcNetidClientSoap.php +++ b/src/main/edu/wisc/doit/RpcNetidClientSoap.php @@ -297,11 +297,11 @@ class RpcNetidClientSoap implements RpcNetidClient { } if( $result->result === 400){ - return new RpcNetidStructValidationResponse(false, $result->Reasons ); + return new RpcNetidStructValidationResponse(false, array($result->Reasons->Reason) ); } if( $result->result === 401){ - return new RpcNetidStructValidationResponse(false, $result->Reasons ); + return new RpcNetidStructValidationResponse(false, array($result->Reasons->Reason) ); } throw new RpcNetidClientSoapException("Unexpected status code: {$result->result}", diff --git a/src/main/edu/wisc/doit/RpcNetidStructValidationResponse.php b/src/main/edu/wisc/doit/RpcNetidStructValidationResponse.php index 48b6741f3ff3bdd0abab55d4df889981adccb80a..2301a03f8a01a0d7d311835410adfedfc2ffa232 100644 --- a/src/main/edu/wisc/doit/RpcNetidStructValidationResponse.php +++ b/src/main/edu/wisc/doit/RpcNetidStructValidationResponse.php @@ -22,7 +22,7 @@ class RpcNetidStructValidationResponse { /** * @param bool $isValid - * @param array $reasons the array of Reason(s) for why the SOAP Call failed + * @param array $reasons the array of a Reason for why the SOAP Call failed */ function __construct( $isValid, array $reasons ) { $this->setIsValid( $isValid ); @@ -45,7 +45,7 @@ class RpcNetidStructValidationResponse { /** * @return string the reason for a password being invalid */ - function getReasons() { return $this->reasons; } + function getReasons() { return $this->reasons[0]; } /** * @param string[] $reason the reason for a password being invalid diff --git a/src/test/RpcNetidClientSoapTest.php b/src/test/RpcNetidClientSoapTest.php index de03d7eeda0a1766a6bea808123373d52bc37913..44dcd85e16cac974e0927e987a086714b7510668 100644 --- a/src/test/RpcNetidClientSoapTest.php +++ b/src/test/RpcNetidClientSoapTest.php @@ -626,7 +626,7 @@ class RpcNetidClientSoapTest extends PHPUnit\Framework\TestCase { $this->assertInstanceOf('edu\wisc\doit\RpcNetidStructValidationResponse', $returned ); $this->assertFalse( $returned->getIsValid() ); - $this->assertContains( RpcNetidStructValidationResponse::REASON_NEEDS_WISCARD, $returned->getReasons() ); + $this->assertEquals( RpcNetidStructValidationResponse::REASON_NEEDS_WISCARD, $returned->getReasons() ); }