CommentRecordTest
extends AjaxHandlerTestCase
in package
CommentRecord test class.
Tags
Table of Contents
- $container : MockContainer
- Mock container
- setUp() : void
- Standard setup method.
- testDisabledResponse() : void
- Test the AJAX handler's response when comments are disabled.
- testEmptyQuery() : void
- Test the AJAX handler's response when the query is empty.
- testLoggedOutUser() : void
- Test the AJAX handler's response when no one is logged in.
- testSuccessfulTransaction() : void
- Test a successful scenario.
- getHandler() : CommentRecord
- Set up a CommentRecord 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.
Properties
$container
Mock container
protected
MockContainer
$container
Methods
setUp()
Standard setup method.
public
setUp() : void
Return values
void —testDisabledResponse()
Test the AJAX handler's response when comments are disabled.
public
testDisabledResponse() : void
Return values
void —testEmptyQuery()
Test the AJAX handler's response when the query is empty.
public
testEmptyQuery() : void
Return values
void —testLoggedOutUser()
Test the AJAX handler's response when no one is logged in.
public
testLoggedOutUser() : void
Return values
void —testSuccessfulTransaction()
Test a successful scenario.
public
testSuccessfulTransaction() : void
Return values
void —getHandler()
Set up a CommentRecord handler for testing.
protected
getHandler([bool $enabled = true ][, UserEntityInterface|null $user = null ]) : CommentRecord
Parameters
- $enabled : bool = true
-
Are comments enabled?
- $user : UserEntityInterface|null = null
-
Return value for getUserObject() in auth manager
Return values
CommentRecord —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