PHP 클래스 Mutagenesis\Adapter\Phpunit

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

공개 메소드들

메소드 설명
execute ( string $jobScript ) : string Execute the generated job which is to call the static main method.
main ( array $arguments, $mutation = null, $bootstrap = null ) : void Uses an instance of PHPUnit_TextUI_Command to execute the PHPUnit tests and simulates any Mutagenesis supported command line options suitable for PHPUnit. At present, we merely dissect a generic 'options' string equivelant to anything typed into a console after a normal 'phpunit' command. The adapter captures the TextUI output for further processing.
processOutput ( string $output ) : boolean Parse the PHPUnit text result output to see if there were any failures.
runTests ( Base $runner, boolean $useStdout = true, boolean $firstRun = false, array $mutation = [], array $testCases = [] ) : array Runs the tests suite according to Runner set options and the execution order of test case (if any). It then returns an array of two elements.

메소드 상세

execute() 공개 정적인 메소드

Execute the generated job which is to call the static main method.
public static execute ( string $jobScript ) : string
$jobScript string
리턴 string $output

main() 공개 정적인 메소드

To prevent duplication of output from stdout, PHPUnit is hard configured to write to stderrm(stdin is used in proc_open call)
public static main ( array $arguments, $mutation = null, $bootstrap = null ) : void
$arguments array Mutagenesis arguments to pass to PHPUnit
리턴 void

processOutput() 공개 정적인 메소드

In the context of mutation testing, a test failure is good (i.e. the mutation was detected by the test suite).
public static processOutput ( string $output ) : boolean
$output string
리턴 boolean

runTests() 공개 메소드

First element is a boolean result value indicating if tests passed or not. Second element is an array containing the key "stdout" which stores the output from the last test run.
public runTests ( Base $runner, boolean $useStdout = true, boolean $firstRun = false, array $mutation = [], array $testCases = [] ) : array
$runner Mutagenesis\Runner\Base
$useStdout boolean
$firstRun boolean
$mutation array
$testCases array
리턴 array