Skip to content
Snippets Groups Projects
Commit 8793b20b authored by Matt Trefilek's avatar Matt Trefilek
Browse files

Maintains functionality with current code

parent 70886146
No related branches found
No related tags found
1 merge request!3Change Reason string to array of reasons
...@@ -297,11 +297,11 @@ class RpcNetidClientSoap implements RpcNetidClient { ...@@ -297,11 +297,11 @@ class RpcNetidClientSoap implements RpcNetidClient {
} }
if( $result->result === 400){ if( $result->result === 400){
return new RpcNetidStructValidationResponse(false, $result->Reasons ); return new RpcNetidStructValidationResponse(false, array($result->Reasons->Reason) );
} }
if( $result->result === 401){ 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}", throw new RpcNetidClientSoapException("Unexpected status code: {$result->result}",
......
...@@ -22,7 +22,7 @@ class RpcNetidStructValidationResponse { ...@@ -22,7 +22,7 @@ class RpcNetidStructValidationResponse {
/** /**
* @param bool $isValid * @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 ) { function __construct( $isValid, array $reasons ) {
$this->setIsValid( $isValid ); $this->setIsValid( $isValid );
...@@ -45,7 +45,7 @@ class RpcNetidStructValidationResponse { ...@@ -45,7 +45,7 @@ class RpcNetidStructValidationResponse {
/** /**
* @return string the reason for a password being invalid * @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 * @param string[] $reason the reason for a password being invalid
......
...@@ -626,7 +626,7 @@ class RpcNetidClientSoapTest extends PHPUnit\Framework\TestCase { ...@@ -626,7 +626,7 @@ class RpcNetidClientSoapTest extends PHPUnit\Framework\TestCase {
$this->assertInstanceOf('edu\wisc\doit\RpcNetidStructValidationResponse', $returned ); $this->assertInstanceOf('edu\wisc\doit\RpcNetidStructValidationResponse', $returned );
$this->assertFalse( $returned->getIsValid() ); $this->assertFalse( $returned->getIsValid() );
$this->assertContains( RpcNetidStructValidationResponse::REASON_NEEDS_WISCARD, $returned->getReasons() ); $this->assertEquals( RpcNetidStructValidationResponse::REASON_NEEDS_WISCARD, $returned->getReasons() );
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment