\Dewdrop\Test\AdminAdminInterface

This interface defined methods useful for testing admin components without having to manually wire up and/or mock admin routing and dispatching.

Summary

Methods
Constants
initHelper()
setMockResponseHelper()
dispatchPage()
getPage()
getResponseHelper()
getComponent()
getDb()
No constants found
No protected methods found
N/A
No private methods found
N/A

Methods

initHelper()

initHelper(string  $componentFolder, string  $componentNamespace) : \Dewdrop\Test\Admin\Dewdrop\Test\Admin\AdminInterface

Initialize the admin helper for this test case. This should be called in your test case's setUp() method so that you can dispatch pages from your component for testing.

Parameters

string $componentFolder
string $componentNamespace

Returns

\Dewdrop\Test\Admin\Dewdrop\Test\Admin\AdminInterface

setMockResponseHelper()

setMockResponseHelper(boolean  $mockResponseHelper) : \Dewdrop\Test\Admin\AdminInterface

Whether to mock the execution of the queued response helper actions.

Parameters

boolean $mockResponseHelper

Returns

\Dewdrop\Test\Admin\AdminInterface

dispatchPage()

dispatchPage(string  $name, array  $post = array(), array  $query = array()) : \Dewdrop\Admin\Response

Dispatch the named page with the POST and GET values supplied to the request object. The response object will be returned so that you can examine the output, etc.

Parameters

string $name
array $post
array $query

Returns

\Dewdrop\Admin\Response

getPage()

getPage(string  $name, array  $post = array(), array  $query = array()) : \Dewdrop\Admin\Page\PageAbstract

Get an object for the named page. Allows you to play with the page outside the stock dispatch loop implemented in ComponentAbstract.

Parameters

string $name
array $post
array $query

Returns

\Dewdrop\Admin\Page\PageAbstract

getResponseHelper()

getResponseHelper(string  $name, array  $post = array(), array  $query = array()) : \Dewdrop\Admin\ResponseHelper\Standard

Complete the init and process portions of the dispatch loop so that we can return the response helper for testing.

Parameters

string $name
array $post
array $query

Returns

\Dewdrop\Admin\ResponseHelper\Standard

getComponent()

getComponent(\Dewdrop\Test\Admin\Request  $request) : \Dewdrop\Admin\ComponentAbstract

Get a component object. This can be useful if you don't want to execute the full page dispatch process but instead want to interact with the component object directly or run selected portions of a page's functionality after routing.

Parameters

\Dewdrop\Test\Admin\Request $request

Returns

\Dewdrop\Admin\ComponentAbstract