PHP Class Crud\Test\TestCase\Action\AddActionTest

Inheritance: extends Crud\TestSuite\IntegrationTestCase
Datei anzeigen Open project: friendsofcake/crud

Public Properties

Property Type Description
$fixtures array fixtures property
$tableClass string Table class to mock on

Public Methods

Method Description
apiGetHttpMethodProvider ( ) : array Data provider with GET and DELETE verbs
apiUpdateHttpMethodProvider ( ) : array Data provider with PUT and POST verbs
testActionGet ( ) : void Test the normal HTTP GET flow of _get
testActionGetWithQueryArgs ( ) : void Test the normal HTTP GET flow of _get with query args
testActionPost ( ) : void Test POST will create a record
testActionPostErrorSave ( ) : void Test POST with unsuccessful save()
testActionPostValidationErrors ( ) : void Test POST with validation errors
testActionPostWithAddRedirect ( ) : void Test POST will create a record and redirect to /blogs/add again if _POST['_add'] is present
testActionPostWithEditRedirect ( ) : void Test POST will create a record and redirect to /blogs/edit/$id if _POST['_edit'] is present
testApiCreate ( string $method ) : void Test POST & PUT verbs using API Listener
testApiCreateError ( string $method ) : void Test POST & PUT verbs using API Listener with data validation error
testApiCreateErrors ( string $method ) : void Test POST & PUT verbs using API Listener with data validation errors
testApiGet ( string $method ) : void Test HTTP & DELETE verbs using API Listener

Method Details

apiGetHttpMethodProvider() public method

Data provider with GET and DELETE verbs
public apiGetHttpMethodProvider ( ) : array
return array

apiUpdateHttpMethodProvider() public method

Data provider with PUT and POST verbs

testActionGet() public method

Test the normal HTTP GET flow of _get
public testActionGet ( ) : void
return void

testActionGetWithQueryArgs() public method

Providing ?name=test should fill out the value in the 'name' input field
public testActionGetWithQueryArgs ( ) : void
return void

testActionPost() public method

Test POST will create a record
public testActionPost ( ) : void
return void

testActionPostErrorSave() public method

Test POST with unsuccessful save()
public testActionPostErrorSave ( ) : void
return void

testActionPostValidationErrors() public method

Test POST with validation errors

testActionPostWithAddRedirect() public method

Test POST will create a record and redirect to /blogs/add again if _POST['_add'] is present

testActionPostWithEditRedirect() public method

Test POST will create a record and redirect to /blogs/edit/$id if _POST['_edit'] is present

testApiCreate() public method

Test POST & PUT verbs using API Listener
public testApiCreate ( string $method ) : void
$method string
return void

testApiCreateError() public method

Test POST & PUT verbs using API Listener with data validation error
public testApiCreateError ( string $method ) : void
$method string
return void

testApiCreateErrors() public method

Test POST & PUT verbs using API Listener with data validation errors
public testApiCreateErrors ( string $method ) : void
$method string
return void

testApiGet() public method

Test HTTP & DELETE verbs using API Listener
public testApiGet ( string $method ) : void
$method string
return void

Property Details

$fixtures public_oe property

fixtures property
public array $fixtures
return array

$tableClass public_oe property

Table class to mock on
public string $tableClass
return string