RouterUnitTestClass
extends BaseRouterUnitTestClass
in package
Tags
Table of Contents
- differentHandlersDataProvider() : array<string|int, mixed>
- Data provider for the test
- helloWorldOutput() : string
- Function simply returns string.
- setRequestMethod() : void
- Function sets $_SERVER['REQUEST_METHOD']
- setUp() : void
- Default setup
- testDifferentHandlers() : void
- Testing router with different handlers
- testRequestMethodsConcurrency() : void
- Testing case when all processors exist
- testSetErrorHandler() : void
- Test validate custom error handlers.
- errorHandler() : void
- Method increments assertion count
- getRouter() : RouterInterface
- Method creates router object
Methods
differentHandlersDataProvider()
Data provider for the test
public
differentHandlersDataProvider() : array<string|int, mixed>
Return values
array<string|int, mixed> —helloWorldOutput()
Function simply returns string.
public
helloWorldOutput() : string
Return values
string —setRequestMethod()
Function sets $_SERVER['REQUEST_METHOD']
public
static setRequestMethod(string $requestMethod) : void
Parameters
- $requestMethod : string
-
request method
Return values
void —setUp()
Default setup
public
setUp() : void
Tags
Return values
void —testDifferentHandlers()
Testing router with different handlers
public
testDifferentHandlers(string $url, callable $handler, string $expectedResult) : void
Parameters
- $url : string
-
url
- $handler : callable
-
handler
- $expectedResult : string
-
expected result
Tags
Return values
void —testRequestMethodsConcurrency()
Testing case when all processors exist
public
testRequestMethodsConcurrency() : void
Return values
void —testSetErrorHandler()
Test validate custom error handlers.
public
testSetErrorHandler() : void
Return values
void —errorHandler()
Method increments assertion count
protected
errorHandler() : void
Return values
void —getRouter()
Method creates router object
protected
abstract getRouter() : RouterInterface