$db
$db : \Dewdrop\Db\Adapter
The DB adapter used by generated components and pages.
This helper is used by all admin test case classes to provide the ability to easily get access to the tested component object and dispatch pages from it. This is used to allow some "horizontal" reuse between the admin test cases because we can't achieve the reuse with inheritance. PHPUnit has a pre-defined hierarchy imposed by its DBUnit extension, so we need to compose our additional functionality in this manner.
$db : \Dewdrop\Db\Adapter
The DB adapter used by generated components and pages.
setMockResponseHelper(boolean $mockResponseHelper) : \Dewdrop\Test\Admin\Helper
Whether to mock the execution of the queued response helper actions.
boolean | $mockResponseHelper |
dispatchPage(string $name, array $post = array(), array $query = array()) : \Dewdrop\Admin\Response\MockResponse
Dispatch a page, using the supplied page name (e.g. "Index" or "Edit") and request data. If you supply any POST data, the request method will be set to POST as well.
string | $name | |
array | $post | |
array | $query |
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.
string | $name | |
array | $post | |
array | $query |
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.
string | $name | |
array | $post | |
array | $query |
getComponent(\Dewdrop\Request $request) : \Dewdrop\Admin\ComponentAbstract
Get a component object, injecting the supplied request so that we can test different responses.
\Dewdrop\Request | $request |
getDb() : \Dewdrop\Db\Adapter
Get a Dewdrop DB adapter.
createRequest(array $post = array(), \Dewdrop\Test\Admin\arary $query = array()) : \Dewdrop\Request
Create a request using the supplied POST and GET values. If there are any POST values, we set the request method to POST.
array | $post | |
\Dewdrop\Test\Admin\arary | $query |