Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
R
rpc-netid-php
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Jira
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
adi-ia
rpc-netid-php
Commits
1e0d1a6c
Commit
1e0d1a6c
authored
9 years ago
by
Andrew Hoffmann
Browse files
Options
Downloads
Patches
Plain Diff
Added integration tests for checkLOA. Some don't pass because of data
issues in Test. I'm considering the checkLOA method to be correct.
parent
a76e1b4e
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/main/edu/wisc/doit/RpcNetidClientSoap.php
+1
-1
1 addition, 1 deletion
src/main/edu/wisc/doit/RpcNetidClientSoap.php
src/test/integration-tests/RpcNetidClientSoapIT.php
+29
-9
29 additions, 9 deletions
src/test/integration-tests/RpcNetidClientSoapIT.php
with
30 additions
and
10 deletions
src/main/edu/wisc/doit/RpcNetidClientSoap.php
+
1
−
1
View file @
1e0d1a6c
...
@@ -175,7 +175,7 @@ class RpcNetidClientSoap implements RpcNetidClient {
...
@@ -175,7 +175,7 @@ class RpcNetidClientSoap implements RpcNetidClient {
RpcNetidClientSoapException
::
UNEXPECTED_STATUS_CODE
);
RpcNetidClientSoapException
::
UNEXPECTED_STATUS_CODE
);
break
;
break
;
case
404
:
case
404
:
throw
new
RpcNetidClientSoapException
(
"no Wiscard eligibility data found for uid"
,
throw
new
RpcNetidClientSoapException
(
"
Web service returned 404:
no Wiscard eligibility data found for uid"
,
RpcNetidClientSoapException
::
UNEXPECTED_STATUS_CODE
);
RpcNetidClientSoapException
::
UNEXPECTED_STATUS_CODE
);
break
;
break
;
case
405
:
case
405
:
...
...
This diff is collapsed.
Click to expand it.
src/test/integration-tests/RpcNetidClientSoapIT.php
+
29
−
9
View file @
1e0d1a6c
...
@@ -3,6 +3,7 @@
...
@@ -3,6 +3,7 @@
use
edu\wisc\doit\RpcNetidClientSoapConfig
;
use
edu\wisc\doit\RpcNetidClientSoapConfig
;
use
edu\wisc\doit\RpcNetidClientSoap
;
use
edu\wisc\doit\RpcNetidClientSoap
;
use
edu\wisc\doit\RpcNetidStructQuestion
;
use
edu\wisc\doit\RpcNetidStructQuestion
;
use
edu\wisc\doit\RpcNetidStructValidationResponse
;
/**
/**
* Integration tests for edu\wisc\doit\RpcNetidClientSoap
* Integration tests for edu\wisc\doit\RpcNetidClientSoap
...
@@ -77,30 +78,49 @@ class RpcNetidClientSoapIT extends PHPUnit_Framework_TestCase {
...
@@ -77,30 +78,49 @@ class RpcNetidClientSoapIT extends PHPUnit_Framework_TestCase {
}
}
/** @test */
/** @test */
public
function
c
redentialCheck_
valid
IT
()
{
public
function
c
heckLOA_Loa2
valid
()
{
$result
=
self
::
$client
->
c
redentialC
heck
(
$result
=
self
::
$client
->
check
LOA
(
self
::
$testData
[
'user'
][
'uid'
],
self
::
$testData
[
'user'
][
'uid'
],
new
DateTime
(
self
::
$testData
[
'user'
][
'birthdate'
]
),
new
DateTime
(
self
::
$testData
[
'user'
][
'birthdate'
]
),
intval
(
self
::
$testData
[
'user'
][
'wiscard'
]
)
);
intval
(
self
::
$testData
[
'user'
][
'wiscard'
]
)
);
$this
->
assertTrue
(
$result
);
$this
->
assertTrue
(
$result
->
getIsValid
()
);
}
}
/** @test test valid credentials for an LOA1 NetID (NetID and DOB only) */
/** @test test valid credentials for an LOA1 NetID (NetID and DOB only) */
public
function
c
redentialC
heck_Loa1Valid
()
{
public
function
check
LOA
_Loa1Valid
()
{
$result
=
self
::
$client
->
c
redentialC
heck
(
$result
=
self
::
$client
->
check
LOA
(
self
::
$testData
[
'loa1-user'
][
'uid'
],
self
::
$testData
[
'loa1-user'
][
'uid'
],
new
DateTime
(
self
::
$testData
[
'loa1-user'
][
'birthdate'
]
)
new
DateTime
(
self
::
$testData
[
'loa1-user'
][
'birthdate'
]
)
);
);
$this
->
assertTrue
(
$result
);
$this
->
assertTrue
(
$result
->
getIsValid
()
);
}
}
/** @test */
/** @test */
public
function
c
redentialC
heck_invalid
IT
()
{
public
function
check
LOA
_invalid
()
{
$result
=
self
::
$client
->
c
redentialC
heck
(
$result
=
self
::
$client
->
check
LOA
(
self
::
$testData
[
'invalid-user'
][
'uid'
],
self
::
$testData
[
'invalid-user'
][
'uid'
],
new
DateTime
(
self
::
$testData
[
'invalid-user'
][
'birthdate'
]
),
new
DateTime
(
self
::
$testData
[
'invalid-user'
][
'birthdate'
]
),
intval
(
self
::
$testData
[
'invalid-user'
][
'wiscard'
]
)
);
intval
(
self
::
$testData
[
'invalid-user'
][
'wiscard'
]
)
);
$this
->
assertFalse
(
$result
);
$this
->
assertFalse
(
$result
->
getIsValid
()
);
}
/** @test Returns invalid if LOA2 and no wiscard provided */
public
function
checkLOA_Loa2_no_wiscard
()
{
$result
=
self
::
$client
->
checkLOA
(
self
::
$testData
[
'user'
][
'uid'
],
new
DateTime
(
self
::
$testData
[
'user'
][
'birthdate'
]
)
);
$this
->
assertFalse
(
$result
->
getIsValid
()
);
$this
->
assertContains
(
RpcNetidStructValidationResponse
::
REASON_NEEDS_WISCARD
,
$result
->
getReasons
()
);
}
/** @test returns valid if LOA1 enters wiscard even if one doesn't exist */
public
function
checkLOA_loa1_with_wiscard_returns_valid
()
{
$result
=
self
::
$client
->
checkLOA
(
self
::
$testData
[
'loa1-user'
][
'uid'
],
new
DateTime
(
self
::
$testData
[
'loa1-user'
][
'birthdate'
]
),
intval
(
12345678901
)
);
$this
->
assertTrue
(
$result
->
getIsValid
()
);
}
}
/** @test */
/** @test */
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment