PHP Class Elgg\RouterTest

Inheritance: extends TestCase
Show file Open project: elgg/elgg

Protected Properties

Property Type Description
$fooHandlerCalls integer
$hooks PluginHooksService
$pages string
$request Elgg\Http\Request
$router Router
$translator Elgg\I18n\Translator
$viewsDir string

Public Methods

Method Description
bar_route_handler ( $hook, $type, $value, $params )
bar_route_identifier ( $hook, $type, $value, $params )
bar_route_override ( $hook, $type, $value, $params )
createService ( )
foo_page_handler ( )
hello_page_handler ( $segments, $identifier )
route ( )
setUp ( )
tearDown ( )
testCanAllowRewrite ( )
testCanFilterResponse ( )
testCanFilterResponseToAjax2ViewRequestForARegisteredFormView ( )
testCanFilterResponseToAjax2ViewRequestForARegisteredView ( )
testCanFilterResponseToAjaxViewRequestForARegisteredFormView ( )
testCanFilterResponseToAjaxViewRequestForARegisteredView ( )
testCanRedirectAjax2RequestFromRouteHook ( )
testCanRedirectAjaxRequestFromRouteHook ( )
testCanRedirectNonAjaxRequestFromRouteHook ( )
testCanRegisterFunctionsAsPageHandlers ( )
testCanRespondToAjax2RequestForPageThatForwards ( )
testCanRespondToAjax2RequestForPageThatForwardsToErrorPage ( )
testCanRespondToAjax2RequestFromErrorResponseBuilder ( )
testCanRespondToAjax2RequestFromOkResponseBuilder ( )
testCanRespondToAjax2RequestFromRedirectResponseBuilder ( )
testCanRespondToAjax2RequestInNonDefaultViewtype ( )
testCanRespondToAjax2RequestThroughRouteHook ( )
testCanRespondToAjax2ViewRequestForARegisteredFormView ( )
testCanRespondToAjax2ViewRequestForARegisteredView ( )
testCanRespondToAjax2ViewRequestForARegisteredViewWhichForwards ( )
testCanRespondToAjax2ViewRequestForCSS ( )
testCanRespondToAjax2ViewRequestForCacheableView ( )
testCanRespondToAjax2ViewRequestForJS ( )
testCanRespondToAjaxRequestForPageThatForwards ( )
testCanRespondToAjaxRequestForPageThatForwardsToErrorPage ( )
testCanRespondToAjaxRequestFromErrorResponseBuilder ( )
testCanRespondToAjaxRequestFromOkResponseBuilder ( )
testCanRespondToAjaxRequestFromRedirectResponseBuilder ( )
testCanRespondToAjaxRequestInNonDefaultViewtype ( )
testCanRespondToAjaxRequestThroughRouteHook ( )
testCanRespondToAjaxViewRequestForARegisteredFormView ( )
testCanRespondToAjaxViewRequestForARegisteredView ( )
testCanRespondToAjaxViewRequestForARegisteredViewWhichForwards ( )
testCanRespondToAjaxViewRequestForCSS ( )
testCanRespondToAjaxViewRequestForCacheableView ( )
testCanRespondToAjaxViewRequestForJS ( )
testCanRespondToNonAjaxRequestForPageThatForwards ( )
testCanRespondToNonAjaxRequestForPageThatForwardsToErrorPage ( )
testCanRespondToNonAjaxRequestFromErrorResponseBuilder ( )
testCanRespondToNonAjaxRequestFromOkResponseBuilder ( )
testCanRespondToNonAjaxRequestFromRedirectResponseBuilder ( )
testCanRespondToNonAjaxRequestInNonDefaultViewtype ( )
testCanRespondToNonAjaxRequestThroughRouteHook ( )
testCanRespondToUnregisteredRoute ( ) See #9796
testCanRespondWithErrorToAjax2ViewRequestForUnallowedView ( )
testCanRespondWithErrorToAjaxViewRequestForUnallowedView ( )
testCanSafelyRedirectWithinRedirect ( )
testCanUnregisterPageHandlers ( )
testFailToRegisterInvalidCallback ( )
testRespondsWithErrorToNonAjaxRequestForAjaxView ( )
testRouteOverridenFromHook ( )
testRouteSupportsSettingHandlerInHookResultForBackwardsCompatibility ( ) 1. Register a page handler for /foo 2. Register a plugin hook that uses the "handler" result param to route all /bar/* requests to the /foo handler.
testRouteSupportsSettingIdentifierInHookResultForBackwardsCompatibility ( ) 1. Register a page handler for /foo 2. Register a plugin hook that uses the "handler" result param to route all /bar/* requests to the /foo handler.

Method Details

bar_route_handler() public method

public bar_route_handler ( $hook, $type, $value, $params )

bar_route_identifier() public method

public bar_route_identifier ( $hook, $type, $value, $params )

bar_route_override() public method

public bar_route_override ( $hook, $type, $value, $params )

createService() public method

public createService ( )

foo_page_handler() public method

public foo_page_handler ( )

hello_page_handler() public method

public hello_page_handler ( $segments, $identifier )

route() public method

public route ( )

setUp() public method

public setUp ( )

tearDown() public method

public tearDown ( )

testCanAllowRewrite() public method

public testCanAllowRewrite ( )

testCanFilterResponse() public method

testCanFilterResponseToAjax2ViewRequestForARegisteredFormView() public method

testCanFilterResponseToAjax2ViewRequestForARegisteredView() public method

testCanFilterResponseToAjaxViewRequestForARegisteredFormView() public method

testCanFilterResponseToAjaxViewRequestForARegisteredView() public method

testCanRedirectAjax2RequestFromRouteHook() public method

testCanRedirectAjaxRequestFromRouteHook() public method

testCanRedirectNonAjaxRequestFromRouteHook() public method

testCanRegisterFunctionsAsPageHandlers() public method

testCanRespondToAjax2RequestForPageThatForwards() public method

testCanRespondToAjax2RequestForPageThatForwardsToErrorPage() public method

testCanRespondToAjax2RequestFromErrorResponseBuilder() public method

testCanRespondToAjax2RequestFromOkResponseBuilder() public method

testCanRespondToAjax2RequestFromRedirectResponseBuilder() public method

testCanRespondToAjax2RequestInNonDefaultViewtype() public method

testCanRespondToAjax2RequestThroughRouteHook() public method

testCanRespondToAjax2ViewRequestForARegisteredFormView() public method

testCanRespondToAjax2ViewRequestForARegisteredView() public method

testCanRespondToAjax2ViewRequestForARegisteredViewWhichForwards() public method

testCanRespondToAjax2ViewRequestForCSS() public method

testCanRespondToAjax2ViewRequestForCacheableView() public method

testCanRespondToAjax2ViewRequestForJS() public method

testCanRespondToAjaxRequestForPageThatForwards() public method

testCanRespondToAjaxRequestForPageThatForwardsToErrorPage() public method

testCanRespondToAjaxRequestFromErrorResponseBuilder() public method

testCanRespondToAjaxRequestFromOkResponseBuilder() public method

testCanRespondToAjaxRequestFromRedirectResponseBuilder() public method

testCanRespondToAjaxRequestInNonDefaultViewtype() public method

testCanRespondToAjaxRequestThroughRouteHook() public method

testCanRespondToAjaxViewRequestForARegisteredFormView() public method

testCanRespondToAjaxViewRequestForARegisteredView() public method

testCanRespondToAjaxViewRequestForARegisteredViewWhichForwards() public method

testCanRespondToAjaxViewRequestForCSS() public method

testCanRespondToAjaxViewRequestForCacheableView() public method

testCanRespondToAjaxViewRequestForJS() public method

testCanRespondToNonAjaxRequestForPageThatForwards() public method

testCanRespondToNonAjaxRequestForPageThatForwardsToErrorPage() public method

testCanRespondToNonAjaxRequestFromErrorResponseBuilder() public method

testCanRespondToNonAjaxRequestFromOkResponseBuilder() public method

testCanRespondToNonAjaxRequestFromRedirectResponseBuilder() public method

testCanRespondToNonAjaxRequestInNonDefaultViewtype() public method

testCanRespondToNonAjaxRequestThroughRouteHook() public method

testCanRespondToUnregisteredRoute() public method

See #9796

testCanRespondWithErrorToAjax2ViewRequestForUnallowedView() public method

testCanRespondWithErrorToAjaxViewRequestForUnallowedView() public method

testCanSafelyRedirectWithinRedirect() public method

testCanUnregisterPageHandlers() public method

testFailToRegisterInvalidCallback() public method

testRespondsWithErrorToNonAjaxRequestForAjaxView() public method

testRouteOverridenFromHook() public method

testRouteSupportsSettingHandlerInHookResultForBackwardsCompatibility() public method

3. Route a request for a /bar page. 4. Check that the /foo handler was called.

testRouteSupportsSettingIdentifierInHookResultForBackwardsCompatibility() public method

3. Route a request for a /bar page. 4. Check that the /foo handler was called.

Property Details

$fooHandlerCalls protected property

protected int $fooHandlerCalls
return integer

$hooks protected property

protected PluginHooksService,elgg $hooks
return PluginHooksService

$pages protected property

protected string $pages
return string

$request protected property

protected Request,Elgg\Http $request
return Elgg\Http\Request

$router protected property

protected Router,elgg $router
return Router

$translator protected property

protected Translator,Elgg\I18n $translator
return Elgg\I18n\Translator

$viewsDir protected property

protected string $viewsDir
return string