Property | Type | Description | |
---|---|---|---|
$_filename | string | Name and relative path of the file to be mutated | |
$_mutables | array | Array of mutable elements located in file | |
$_mutations | array | An array of generated mutations to be sequentially tested |
Method | Description | |
---|---|---|
__construct ( string $filename = null ) | Constructor; sets name and relative path of the file being mutated | |
_parseTString ( array $token ) : string | Parse a T_STRING value to identify a possible mutation type | |
cleanup ( ) | Cleanup routines for memory management | |
generate ( ) : void | Based on the current file, generate mutations | |
getFilename ( ) : string | Return the file path of the file which is currently being assessed for mutations. | |
getMutables ( ) : array | Get an array of method metainfo in tokenised form representing methods which are capable of being mutated. Note: This does not guarantee they will be mutated since this depends on the scope of supported mutations. | |
getMutations ( ) : array | Get an array of Class & Method indexed mutations containing the mutated token and that token's index in the method's block code. | |
hasMutation ( string $type ) : boolean | Check whether the current file will contain a mutation of the given type | |
setFilename ( string $filename ) | Set the file path of the file which is currently being assessed for mutations. |
Method | Description | |
---|---|---|
_parseMutables ( ) : array | Parse the given file into an array of method metainformation including class name, method name, file name, method arguments, and method body tokens. | |
_parseStringToken ( array $token, integer $index ) : mixed | Parse a given token (in string form) to identify its type and ascertain whether it can be replaced with a mutated form. The mutated form, if any, is returned for future integration into a mutated version of the source code being tested. | |
_parseToken ( array $token, integer $index ) : mixed | Parse a given token (in array form) to identify its type and ascertain whether it can be replaced with a mutated form. The mutated form, if any, is returned for future integration into a mutated version of the source code being tested. | |
_parseTokensToMutations ( array $mutables ) : void | Based on the internal array of mutable methods, generate another internal array of supported mutations accessible using getMutations(). | |
_reconstructFromTokens ( array $tokens ) : string | Reconstruct a string of source code from its constituent tokens |
public __construct ( string $filename = null ) | ||
$filename | string |
protected _parseMutables ( ) : array | ||
return | array |
public _parseTString ( array $token ) : string | ||
$token | array | |
return | string |
protected _parseTokensToMutations ( array $mutables ) : void | ||
$mutables | array | |
return | void |
protected _reconstructFromTokens ( array $tokens ) : string | ||
$tokens | array | |
return | string |
public getFilename ( ) : string | ||
return | string |
public getMutables ( ) : array | ||
return | array |
public getMutations ( ) : array | ||
return | array |
public hasMutation ( string $type ) : boolean | ||
$type | string | The mutation type as documented |
return | boolean |
public setFilename ( string $filename ) | ||
$filename | string |
protected string $_filename | ||
return | string |
protected array $_mutables | ||
return | array |
protected array $_mutations | ||
return | array |