PHP 클래스 Mutagenesis\Mutable

파일 보기 프로젝트 열기: padraic/mutagenesis 1 사용 예제들

보호된 프로퍼티들

프로퍼티 타입 설명
$_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

공개 메소드들

메소드 설명
__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.

보호된 메소드들

메소드 설명
_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

메소드 상세

__construct() 공개 메소드

Constructor; sets name and relative path of the file being mutated
public __construct ( string $filename = null )
$filename string

_parseMutables() 보호된 메소드

Parse the given file into an array of method metainformation including class name, method name, file name, method arguments, and method body tokens.
protected _parseMutables ( ) : array
리턴 array

_parseStringToken() 보호된 메소드

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.
protected _parseStringToken ( array $token, integer $index ) : mixed
$token array The token to check for viable mutations
$index integer The index of the token in the method's body
리턴 mixed Return null if no mutation, or a mutation object

_parseTString() 공개 메소드

Parse a T_STRING value to identify a possible mutation type
public _parseTString ( array $token ) : string
$token array
리턴 string

_parseToken() 보호된 메소드

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.
protected _parseToken ( array $token, integer $index ) : mixed
$token array The token to check for viable mutations
$index integer The index of the token in the method's body
리턴 mixed Return null if no mutation, or a mutation object

_parseTokensToMutations() 보호된 메소드

Based on the internal array of mutable methods, generate another internal array of supported mutations accessible using getMutations().
protected _parseTokensToMutations ( array $mutables ) : void
$mutables array
리턴 void

_reconstructFromTokens() 보호된 메소드

Reconstruct a string of source code from its constituent tokens
protected _reconstructFromTokens ( array $tokens ) : string
$tokens array
리턴 string

cleanup() 공개 메소드

Cleanup routines for memory management
public cleanup ( )

generate() 공개 메소드

Based on the current file, generate mutations
public generate ( ) : void
리턴 void

getFilename() 공개 메소드

Return the file path of the file which is currently being assessed for mutations.
public getFilename ( ) : string
리턴 string

getMutables() 공개 메소드

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.
public getMutables ( ) : array
리턴 array

getMutations() 공개 메소드

Get an array of Class & Method indexed mutations containing the mutated token and that token's index in the method's block code.
public getMutations ( ) : array
리턴 array

hasMutation() 공개 메소드

Check whether the current file will contain a mutation of the given type
public hasMutation ( string $type ) : boolean
$type string The mutation type as documented
리턴 boolean

setFilename() 공개 메소드

Set the file path of the file which is currently being assessed for mutations.
public setFilename ( string $filename )
$filename string

프로퍼티 상세

$_filename 보호되어 있는 프로퍼티

Name and relative path of the file to be mutated
protected string $_filename
리턴 string

$_mutables 보호되어 있는 프로퍼티

Array of mutable elements located in file
protected array $_mutables
리턴 array

$_mutations 보호되어 있는 프로퍼티

An array of generated mutations to be sequentially tested
protected array $_mutations
리턴 array