Property | Type | Description | |
---|---|---|---|
$classSuffixes | array | class types that methods can be generated for | |
$classTypes | array | class types that methods can be generated for | |
$tasks | array | Tasks used. |
Property | Type | Description | |
---|---|---|---|
$_fixtures | array | Internal list of fixtures that have been added so far. |
Method | Description | |
---|---|---|
bake ( string $type, string $className ) : string | boolean | Completes final steps for generating data to create test case. | |
buildTestSubject ( string $type, string $class ) : object | Construct an instance of the class to be tested. | |
generateConstructor ( string $type, string $fullClassName ) : array | Generate a constructor code snippet for the type and class name | |
generateFixtureList ( object $subject ) : array | Generate the list of fixtures that will be required to run this test based on loaded models. | |
generateProperties ( string $type, string $subject, string $fullClassName ) : array | Generate property info for the type and class name | |
generateUses ( string $type, string $fullClassName ) : array | Generate the uses() calls for a type & class name | |
getOptionParser ( ) : Cake\Console\ConsoleOptionParser | Gets the option parser instance and configures it. | |
getPath ( ) : string | Get the file path. | |
getRealClassName ( string $type, string $class ) : string | Gets the real class name from the cake short form. If the class name is already suffixed with the type, the type will not be duplicated. | |
getSubspacePath ( string $type ) : string | Gets the subspace path for a test. | |
getTestableMethods ( string $className ) : array | Get methods declared in the class given. | |
hasMockClass ( string $type ) : boolean | Is a mock class required for this type of test? Controllers require a mock class. | |
main ( string | null $type = null, string | null $name = null ) : void | array | Execution method always used for tasks | |
mapType ( string $type ) : string | Map the types that TestTask uses to concrete types that App::className can use. | |
outputClassChoices ( string $type ) : array | Output a list of possible classnames you might want to generate a test for. | |
outputTypeChoices ( ) : void | Output a list of class types you can bake a test for. | |
testCaseFileName ( string $type, string $className ) : string | Make the filename for the test case. resolve the suffixes for controllers and get the plugin path if needed. | |
typeCanDetectFixtures ( string $type ) : boolean | Checks whether the chosen type can find its own fixtures. |
Method | Description | |
---|---|---|
_addFixture ( string $name ) : void | Add class name to the fixture list. | |
_bakeAll ( string $type ) : void | ||
_getClassOptions ( string $namespace ) : array | Get the possible classes for a given type. | |
_processController ( |
Process all the models attached to a controller and generate a fixture list. | |
_processModel ( Model $subject ) : void | Process a model recursively and pull out all the model names converting them to fixture names. |
protected _addFixture ( string $name ) : void | ||
$name | string | Name of the Model class that a fixture might be required for. |
return | void |
protected _getClassOptions ( string $namespace ) : array | ||
$namespace | string | The namespace fragment to look for classes in. |
return | array |
protected _processController ( |
||
$subject | A controller to pull model names off of. | |
return | void |
protected _processModel ( Model $subject ) : void | ||
$subject | Model | A Model class to scan for associations and pull fixtures off of. |
return | void |
public generateConstructor ( string $type, string $fullClassName ) : array | ||
$type | string | The Type of object you are generating tests for eg. controller |
$fullClassName | string | The full classname of the class the test is being generated for. |
return | array | Constructor snippets for the thing you are building. |
public generateFixtureList ( object $subject ) : array | ||
$subject | object | The object you want to generate fixtures for. |
return | array | Array of fixtures to be included in the test. |
public generateProperties ( string $type, string $subject, string $fullClassName ) : array | ||
$type | string | The Type of object you are generating tests for eg. controller |
$subject | string | The name of the test subject. |
$fullClassName | string | The Classname of the class the test is being generated for. |
return | array | An array containing property info |
public getOptionParser ( ) : Cake\Console\ConsoleOptionParser | ||
return | Cake\Console\ConsoleOptionParser |
public getSubspacePath ( string $type ) : string | ||
$type | string | The Type of object you are generating tests for eg. controller. |
return | string | Path of the subspace. |
public getTestableMethods ( string $className ) : array | ||
$className | string | Name of class to look at. |
return | array | Array of method names. |
public hasMockClass ( string $type ) : boolean | ||
$type | string | The type of object tests are being generated for eg. controller. |
return | boolean |
public outputClassChoices ( string $type ) : array | ||
$type | string | The typename to get classes for. |
return | array |
public outputTypeChoices ( ) : void | ||
return | void |
public typeCanDetectFixtures ( string $type ) : boolean | ||
$type | string | The Type of object you are generating tests for eg. controller |
return | boolean |
protected array $_fixtures | ||
return | array |
public array $classSuffixes | ||
return | array |
public array $classTypes | ||
return | array |