PHP Class Crud\TestCase\Controller\Crud\CrudComponentTest

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

Public Properties

Property Type Description
$fixtures Use the core posts fixture to have something to work on. What fixture is used is almost irrelevant, was chosen as it is simple

Public Methods

Method Description
setUp ( ) setUp
tearDown ( ) tearDown method
testAddListenerByNameAndClassName ( ) : void Test adding a listener by name and class name
testAddListenerOnlyClassName ( ) : void Test adding a listener only by class name
testAddListenerWithDefaults ( ) : void Test that addListener works - with listener default config
testAddListenerWithoutDefaults ( ) : void Test that addListener works - without listener default config
testConfigMergeWorks ( ) : void Test that it's possible to change just one sub key by providing all the parents, without loosing any default settings
testConfigNormalization ( ) : void Test config normalization
testConfigOverwrite ( ) : void Using $key and value, and specifying no merge should overwrite the value keys
testConstructMerging ( ) : void Test that providing configuration for a new listener in the Crud setting should preserve the defaults and add the new listener to the array
testConstructMerging2 ( ) : void Test that providing configuration for a new listener in the Crud setting should preserve the defaults and add the new listener to the array
testControllerWithEmptyUses ( ) : void Test the Crud sets model and modelClass to NULL if there is no model defined in the controller
testCrudWillComplainAboutUnmappedAction ( ) : void Test if crud complains about unmapped actions
testDefaultConfig ( ) : void Test the default configuration for CrudComponent
testDefaultsListenerNotAlreadyLoaded ( ) : void Test setting defaults for one listener works
testDefaultsMultipleActions ( ) : void Test setting defaults for multiple actions work
testDefaultsMultipleListeners ( ) : void Test setting defaults for multiple actions work
testDefaultsOnAction ( ) : void Test setting defaults for one action works
testDefaultsOneListener ( ) : void Test setting defaults for one listener works
testDisableAction ( ) testDisableAction
testEnable ( ) testEnable
testExecuteActionToExecute ( ) Test deprecated executeAction calls execute correctly
testFindMethodMultipleActions ( ) : void Test changing view var for multiple actions works
testIsActionMappedNo ( ) testIsActionMappedNo
testIsActionMappedYes ( ) testIsActionMappedYes
testLoadListener ( ) : void testLoadListener
testMapAction ( ) testMapAction
testMappingNonExistentAction ( ) : void testMappingNonExistentAction
testOn ( ) Tests on method registers an event
testOnWithPriPriority ( ) tests on method registers an event with extra params
testRemoveListener ( ) : void Test that removeListener works
testRemoveListenerNoExist ( ) : void Test removing a listener that doesn't exist should return false
testSetModelPropertiesDefault ( ) : void Test that having no mapped model for an action, just use the modelClass from the controller
testUseModel ( ) : void Tests that is possible to set the model class to use for the action
testView ( ) testView
testViewCanBeChangedInControllerAction ( ) : void Test that having a 'search' action in the controller and calling ->execute('index') will still render the 'search' view
testViewVarMultipleActions ( ) : void Test changing view var for multiple actions works
testViewVarSingleAction ( ) : void Test changing view var for one action works
testViewWithArrayIndexAction ( ) : void Test if view with array yields the expected result
testViewWithArrayNewAction ( ) : void Test if view with array yields the expected result

Method Details

setUp() public method

Setup the classes the crud component needs to be testable
public setUp ( )

tearDown() public method

tearDown method
public tearDown ( )

testAddListenerByNameAndClassName() public method

Test adding a listener by name and class name

testAddListenerOnlyClassName() public method

Test adding a listener only by class name
public testAddListenerOnlyClassName ( ) : void
return void

testAddListenerWithDefaults() public method

Test that addListener works - with listener default config
public testAddListenerWithDefaults ( ) : void
return void

testAddListenerWithoutDefaults() public method

Test that addListener works - without listener default config

testConfigMergeWorks() public method

Test that it's possible to change just one sub key by providing all the parents, without loosing any default settings
public testConfigMergeWorks ( ) : void
return void

testConfigNormalization() public method

Test config normalization
public testConfigNormalization ( ) : void
return void

testConfigOverwrite() public method

Using $key and value, and specifying no merge should overwrite the value keys
public testConfigOverwrite ( ) : void
return void

testConstructMerging() public method

Test that providing configuration for a new listener in the Crud setting should preserve the defaults and add the new listener to the array
public testConstructMerging ( ) : void
return void

testConstructMerging2() public method

Test that providing configuration for a new listener in the Crud setting should preserve the defaults and add the new listener to the array
public testConstructMerging2 ( ) : void
return void

testControllerWithEmptyUses() public method

Test the Crud sets model and modelClass to NULL if there is no model defined in the controller
public testControllerWithEmptyUses ( ) : void
return void

testCrudWillComplainAboutUnmappedAction() public method

Test if crud complains about unmapped actions

testDefaultConfig() public method

Test the default configuration for CrudComponent
public testDefaultConfig ( ) : void
return void

testDefaultsListenerNotAlreadyLoaded() public method

This proves that not setting 'className' doesn't break

testDefaultsMultipleActions() public method

Test setting defaults for multiple actions work
public testDefaultsMultipleActions ( ) : void
return void

testDefaultsMultipleListeners() public method

Test setting defaults for multiple actions work

testDefaultsOnAction() public method

Test setting defaults for one action works
public testDefaultsOnAction ( ) : void
return void

testDefaultsOneListener() public method

Test setting defaults for one listener works
public testDefaultsOneListener ( ) : void
return void

testDisableAction() public method

testDisableAction
public testDisableAction ( )

testEnable() public method

testEnable
public testEnable ( )

testExecuteActionToExecute() public method

Test deprecated executeAction calls execute correctly

testFindMethodMultipleActions() public method

Test changing view var for multiple actions works

testIsActionMappedNo() public method

testIsActionMappedNo

testIsActionMappedYes() public method

testIsActionMappedYes

testLoadListener() public method

testLoadListener
public testLoadListener ( ) : void
return void

testMapAction() public method

testMapAction
public testMapAction ( )

testMappingNonExistentAction() public method

testMappingNonExistentAction
public testMappingNonExistentAction ( ) : void
return void

testOn() public method

Tests on method registers an event
public testOn ( )

testOnWithPriPriority() public method

tests on method registers an event with extra params

testRemoveListener() public method

Test that removeListener works
public testRemoveListener ( ) : void
return void

testRemoveListenerNoExist() public method

Test removing a listener that doesn't exist should return false
public testRemoveListenerNoExist ( ) : void
return void

testSetModelPropertiesDefault() public method

Test that having no mapped model for an action, just use the modelClass from the controller

testUseModel() public method

Tests that is possible to set the model class to use for the action
public testUseModel ( ) : void
return void

testView() public method

testView
public testView ( )

testViewCanBeChangedInControllerAction() public method

Test that having a 'search' action in the controller and calling ->execute('index') will still render the 'search' view

testViewVarMultipleActions() public method

Test changing view var for multiple actions works
public testViewVarMultipleActions ( ) : void
return void

testViewVarSingleAction() public method

Test changing view var for one action works
public testViewVarSingleAction ( ) : void
return void

testViewWithArrayIndexAction() public method

Test if view with array yields the expected result
public testViewWithArrayIndexAction ( ) : void
return void

testViewWithArrayNewAction() public method

Test if view with array yields the expected result
public testViewWithArrayNewAction ( ) : void
return void

Property Details

$fixtures public_oe property

Use the core posts fixture to have something to work on. What fixture is used is almost irrelevant, was chosen as it is simple
public $fixtures