diff --git a/.gitignore b/.gitignore index 180786fad3ac794b7745808746faa0c1a59f3519..1a1e3e1726451d37e3858fb3d8f3df09ff0797c7 100644 --- a/.gitignore +++ b/.gitignore @@ -10,6 +10,7 @@ /phpunit.phar /docs /modules +/go-pear.phar /src/main/wsdltophp/prod/RPCNetID/* /src/main/wsdltophp/prod/RPCNetID/.gitkeep diff --git a/src/main/edu/wisc/doit/RpcNetidClient.php b/src/main/edu/wisc/doit/RpcNetidClient.php index 74af635d673aec9159b96b497da2138eb1436d23..00a2477396db9ebb573fcd526a3cf8927b4a5b55 100644 --- a/src/main/edu/wisc/doit/RpcNetidClient.php +++ b/src/main/edu/wisc/doit/RpcNetidClient.php @@ -73,7 +73,8 @@ interface RpcNetidClient { /** * Validates a NetID password meets complexity requirements - * + * + * @param string $uid the user's netid * @param string $password the password * @return RpcNetidStructValidationResponse indicates if valid and the reason for invalid */ diff --git a/src/main/edu/wisc/doit/RpcNetidClientSoap.php b/src/main/edu/wisc/doit/RpcNetidClientSoap.php index 1680ab20badbbef5c33cafb8bb213ed365372982..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->Reason ); + return new RpcNetidStructValidationResponse(false, array($result->Reasons->Reason) ); } if( $result->result === 401){ - return new RpcNetidStructValidationResponse(false, $result->Reasons->Reason ); + 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 729d61cd4b996a0e2cbbdab13d9b0eac75a29f5d..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 string $reason + * @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() ); }