CheckRequestIsValidTest
extends AjaxHandlerTestCase
in package
CheckRequestIsValid test class.
Tags
Table of Contents
- $container : MockContainer
- Mock container
- setUp() : void
- Standard setup method.
- testEmptyQuery() : void
- Test the AJAX handler's response when the query is empty.
- testHoldResponse() : void
- Test a successful hold response.
- testILLResponse() : void
- Test a successful ILL response.
- testLoggedOutUser() : void
- Test the AJAX handler's response when no one is logged in.
- testStorageResponse() : void
- Test a successful storage retrieval response.
- getHandler() : CheckRequestIsValid
- Set up a CheckRequestIsValid handler for testing.
- getMockAuthManager() : MockObject|Manager
- Get an auth manager with a value set for getUserObject.
- getMockUser() : MockObject|UserEntityInterface
- Create mock user object.
- getParamsHelper() : Params
- Build a Params helper for testing.
- runSuccessfulTest() : array<string|int, mixed>
- Generic support function for successful request tests.
Properties
$container
Mock container
protected
MockContainer
$container
Methods
setUp()
Standard setup method.
public
setUp() : void
Return values
void —testEmptyQuery()
Test the AJAX handler's response when the query is empty.
public
testEmptyQuery() : void
Return values
void —testHoldResponse()
Test a successful hold response.
public
testHoldResponse() : void
Return values
void —testILLResponse()
Test a successful ILL response.
public
testILLResponse() : void
Return values
void —testLoggedOutUser()
Test the AJAX handler's response when no one is logged in.
public
testLoggedOutUser() : void
Return values
void —testStorageResponse()
Test a successful storage retrieval response.
public
testStorageResponse() : void
Return values
void —getHandler()
Set up a CheckRequestIsValid handler for testing.
protected
getHandler([UserEntityInterface|null $user = null ]) : CheckRequestIsValid
Parameters
- $user : UserEntityInterface|null = null
-
Return value for getUserObject() in auth manager
Return values
CheckRequestIsValid —getMockAuthManager()
Get an auth manager with a value set for getUserObject.
protected
getMockAuthManager([UserEntityInterface|null $user = null ]) : MockObject|Manager
Parameters
- $user : UserEntityInterface|null = null
-
Return value for getUserObject()
Return values
MockObject|Manager —getMockUser()
Create mock user object.
protected
getMockUser() : MockObject|UserEntityInterface
Return values
MockObject|UserEntityInterface —getParamsHelper()
Build a Params helper for testing.
protected
getParamsHelper([array<string|int, mixed> $get = [] ][, array<string|int, mixed> $post = [] ]) : Params
Parameters
- $get : array<string|int, mixed> = []
-
GET parameters
- $post : array<string|int, mixed> = []
-
POST parameters
Return values
Params —runSuccessfulTest()
Generic support function for successful request tests.
protected
runSuccessfulTest(string $ilsMethod[, string|null $requestType = null ]) : array<string|int, mixed>
Parameters
- $ilsMethod : string
-
ILS method to mock
- $requestType : string|null = null
-
Request type for params helper