Property | Type | Description | |
---|---|---|---|
$dependedFixtures | array | Fixtures | |
$fixtures | array | Fixtures | |
$plugin | string | Autoload entrypoint for fixtures dependecy solver |
Property | Type | Description | |
---|---|---|---|
$_testsToRun | array | Test to run for the test case (e.g array('testFind', 'testView')) If this attribute is not empty only the tests from the list will be executed |
Method | Description | |
---|---|---|
__construct ( $name = null, array $data = [], $dataName = '' ) : void | Constructor | |
assertFalse ( $condition, $message = '' ) | ||
assertInvalid ( Model $Model, array $data ) : void | Asserts that data are invalid given Model validation rules Calls the Model::validate() method and asserts the result | |
assertIsA ( $actual, $expected, $message = '' ) | ||
assertNotA ( $actual, $expected, $message = '' ) | ||
assertTrue ( $condition, $message = '' ) | ||
assertValid ( Model $Model, array $data ) : void | Asserts that data are valid given Model validation rules Calls the Model::validate() method and asserts the result | |
assertValidationErrors ( Model $Model, array $data, array $expectedErrors ) : void | Asserts that data are validation errors match an expected value when validation given data for the Model Calls the Model::validate() method and asserts validationErrors | |
getTests ( ) : array | Overrides parent method to allow selecting tests to run in the current test case It is useful when working on one particular test | |
loadConfig ( string $fileName, string $type = 'app' ) : mixed | Loads a file from app/tests/config/configure_file.php or app/plugins/PLUGIN/tests/config/configure_file.php | |
mockCakeEmail ( ) : PHPUnit_Framework_MockObject_MockObject | Provides conventional method to mock CakeEmail object | |
pass ( $message = '' ) | ||
solveDependancies ( string $plugin ) : array | Solves Plugin Fixture dependancies. Called in AppTestCase::__construct to solve fixture dependancies. Uses a Plugins tests/config/dependent and tests/config/fixtures to load plugin fixtures. To use this feature set $plugin = 'pluginName' in your test case. |
Method | Description | |
---|---|---|
_validData ( Model $Model, array $data, array &$validationErrors = [] ) : boolean | Convenience method allowing to validate data and return the result |
public __construct ( $name = null, array $data = [], $dataName = '' ) : void | ||
$data | array | |
return | void |
protected _validData ( Model $Model, array $data, array &$validationErrors = [] ) : boolean | ||
$Model | Model | Model being tested |
$data | array | Profile data |
$validationErrors | array | Validation errors: this variable will be updated with validationErrors (sorted by key) in case of validation fail |
return | boolean | Return value of Model::validate() |
public assertInvalid ( Model $Model, array $data ) : void | ||
$Model | Model | Model being tested |
$data | array | Data to validate |
return | void |
public assertValid ( Model $Model, array $data ) : void | ||
$Model | Model | Model being tested |
$data | array | Data to validate |
return | void |
public loadConfig ( string $fileName, string $type = 'app' ) : mixed | ||
$fileName | string | name of file to load, extension must be .php and only the name should be used, not the extenstion. |
$type | string | Type of config file being loaded. If equal to 'app' core config files will be use. if $type == 'pluginName' that plugins tests/config files will be loaded. |
return | mixed | false if file not found, void if load successful |
public mockCakeEmail ( ) : PHPUnit_Framework_MockObject_MockObject | ||
return | PHPUnit_Framework_MockObject_MockObject |
public solveDependancies ( string $plugin ) : array | ||
$plugin | string | Name of the plugin to load |
return | array | Array of plugins that this plugin's test cases depend on. |
protected array $_testsToRun | ||
return | array |
public string $plugin | ||
return | string |