PHP Class Mutagenesis\Runner\RunnerAbstract

Datei anzeigen Open project: padraic/mutagenesis Class Usage Examples

Protected Properties

Property Type Description
$_adapter Mutagenesis\Adapter\AdapterAbstract Instance of \Mutagenesis\Adapter\AdapterAbstract linking Mutagenesis to to an underlying test framework to execute tests and parse the test results
$_adapterConstraint string Adapter constraint. Used in initial run to analyse what tests/cases/suites are to be executed. For example, calling "phpunit MyTests MyTests.php" sets a constraint of "MyTests MyTests.php". Used to narrow the focus of the current mutation testing run if needed (e.g. spreading testing over time)
$_adapterName string Name of the test adapter, e.g. phpunit, to utilise
$_adapterOptions string String of adapter options appended to any call to the current adapter's testing utility command (e.g. passing 'AllTests.php' to phpunit)
$_baseDirectory string Path to the base directory of the project being mutated
$_bootstrap string Test framework bootstrap
$_cacheDirectory string Path to a cache directory used by library to store working files such as PHPUnit logs needed to analyse test case execution times.
$_detailCaptures boolean Flag to add detailed reports (including test results) about the mutations which caused test failures (i.e. captured)
$_generator Mutagenesis\Generator Instance of \Mutagenesis\Generator used to generate mutations from the underlying source code
$_mutables array Stored mutables each containing relevant mutations for the source code being tested
$_options array Generic options, possibly of future use to other test frameworks
$_renderer Mutagenesis\Renderer\Text Instance of a suitable renderer used to format results into output
$_rendererName string Name of the renderer, e.g. text, to utilise
$_runkit Mutagenesis\Utility\Runkit Instance of \Mutagenesis\Runkit used to apply and reverse mutations on loaded source code within the same process dynamically
$_sourceDirectory string Path to the source directory of the project being mutated
$_testDirectory string Path to the tests directory of the project being mutated
$_timeout integer Timeout in seconds allowed per test execution.

Public Methods

Method Description
execute ( ) : void Execute the runner
getAdapter ( ) : AdapterAbstract Get a test framework adapter. Creates a new one based on the configured adapter name passed on the CLI if not already set.
getAdapterConstraint ( ) : string Get name of the test adapter to use
getAdapterName ( ) : string Get name of the test adapter to use
getAdapterOptions ( ) : string Get a space delimited string of testing tool options
getBaseDirectory ( ) : string Get the base directory of the project being mutated
getBootstrap ( ) : string Get a bootstrap file included before tests run
getCacheDirectory ( ) : string Get the cache directory of the project being mutated
getDetailCaptures ( ) : boolean Get flag to add detailed reports (including test results) about the mutations which caused test failures (i.e. captured)
getGenerator ( ) : Generator Get a specific Generator of mutations.
getMutables ( ) : array Generate Mutants!
getOptions ( ) : array Compile all necessary options for the test framework adapter
getRenderer ( ) : Mutagenesis\Renderer\RendererInterface Get a result renderer. Creates a new one based on the configured renderer name passed on the CLI if not already set.
getRendererName ( ) : string Get name of the renderer to use
getRunkit ( ) : Mutagenesis\Runkit Creates and returns a new instance of \Mutagenesis\Runkit if not previously loaded
getSourceDirectory ( ) : string Get the source directory of the project being mutated
getTestDirectory ( ) : string Get the test directory of the project being mutated
getTimeout ( ) : null | integer Get timeout in seconds for each test run
setAdapter ( AdapterAbstract $adapter ) Set a test framework adapter.
setAdapterConstraint ( $constraint ) Set name of the test adapter to use
setAdapterName ( string $adapter ) Set name of the test adapter to use
setAdapterOption ( string $optionString ) Options to pass to adapter's underlying command
setAdapterOptions ( array | string $options ) : self Set many options for adapter's underlying cli command
setBaseDirectory ( string $dir ) Set the base directory of the project being mutated
setBootstrap ( string $file ) Set a bootstrap file included before tests run (e.g. setup autoloading)
setCacheDirectory ( string $dir ) Set the cache directory of the project being mutated
setDetailCaptures ( boolean $bool ) Set flag to add detailed reports (including test results) about the mutations which caused test failures (i.e. captured)
setGenerator ( Generator $generator ) Set a specific Generator of mutations (stuck with a subclass).
setOption ( string $name, mixed $value ) Set a generic option
setOptions ( array $options ) Set generic options
setRenderer ( Mutagenesis\Renderer\RendererInterface $renderer ) Set a test framework adapter.
setRendererName ( string $rname ) Set name of the renderer to use
setRunkit ( Runkit $runkit ) Set a custom runkit instance.
setSourceDirectory ( string $dir ) Set the source directory of the project being mutated
setTestDirectory ( string $dir ) Set the test directory of the project being mutated
setTimeout ( integer $timeout ) Set timeout in seconds for each test run

Method Details

execute() abstract public method

Execute the runner
abstract public execute ( ) : void
return void

getAdapter() public method

Get a test framework adapter. Creates a new one based on the configured adapter name passed on the CLI if not already set.
public getAdapter ( ) : AdapterAbstract
return Mutagenesis\Adapter\AdapterAbstract

getAdapterConstraint() public method

Get name of the test adapter to use
public getAdapterConstraint ( ) : string
return string

getAdapterName() public method

Get name of the test adapter to use
public getAdapterName ( ) : string
return string

getAdapterOptions() public method

Get a space delimited string of testing tool options
public getAdapterOptions ( ) : string
return string

getBaseDirectory() public method

Get the base directory of the project being mutated
public getBaseDirectory ( ) : string
return string

getBootstrap() public method

Get a bootstrap file included before tests run
public getBootstrap ( ) : string
return string

getCacheDirectory() public method

Get the cache directory of the project being mutated
public getCacheDirectory ( ) : string
return string

getDetailCaptures() public method

Get flag to add detailed reports (including test results) about the mutations which caused test failures (i.e. captured)
public getDetailCaptures ( ) : boolean
return boolean

getGenerator() public method

Get a specific Generator of mutations.
public getGenerator ( ) : Generator
return Mutagenesis\Generator

getMutables() public method

Generate Mutants!
public getMutables ( ) : array
return array

getOptions() public method

Compile all necessary options for the test framework adapter
public getOptions ( ) : array
return array

getRenderer() public method

Get a result renderer. Creates a new one based on the configured renderer name passed on the CLI if not already set.
public getRenderer ( ) : Mutagenesis\Renderer\RendererInterface
return Mutagenesis\Renderer\RendererInterface

getRendererName() public method

Get name of the renderer to use
public getRendererName ( ) : string
return string

getRunkit() public method

Creates and returns a new instance of \Mutagenesis\Runkit if not previously loaded
public getRunkit ( ) : Mutagenesis\Runkit
return Mutagenesis\Runkit

getSourceDirectory() public method

Get the source directory of the project being mutated
public getSourceDirectory ( ) : string
return string

getTestDirectory() public method

Get the test directory of the project being mutated
public getTestDirectory ( ) : string
return string

getTimeout() public method

Get timeout in seconds for each test run
public getTimeout ( ) : null | integer
return null | integer

setAdapter() public method

Set a test framework adapter.
public setAdapter ( AdapterAbstract $adapter )
$adapter Mutagenesis\Adapter\AdapterAbstract

setAdapterConstraint() public method

Set name of the test adapter to use
public setAdapterConstraint ( $constraint )

setAdapterName() public method

Set name of the test adapter to use
public setAdapterName ( string $adapter )
$adapter string

setAdapterOption() public method

Options to pass to adapter's underlying command
public setAdapterOption ( string $optionString )
$optionString string

setAdapterOptions() public method

Set many options for adapter's underlying cli command
public setAdapterOptions ( array | string $options ) : self
$options array | string Array or serialized array of options
return self

setBaseDirectory() public method

Set the base directory of the project being mutated
public setBaseDirectory ( string $dir )
$dir string

setBootstrap() public method

Set a bootstrap file included before tests run (e.g. setup autoloading)
public setBootstrap ( string $file )
$file string

setCacheDirectory() public method

Set the cache directory of the project being mutated
public setCacheDirectory ( string $dir )
$dir string

setDetailCaptures() public method

Set flag to add detailed reports (including test results) about the mutations which caused test failures (i.e. captured)
public setDetailCaptures ( boolean $bool )
$bool boolean

setGenerator() public method

TODO Add interface
public setGenerator ( Generator $generator )
$generator Mutagenesis\Generator

setOption() public method

Set a generic option
public setOption ( string $name, mixed $value )
$name string
$value mixed

setOptions() public method

Set generic options
public setOptions ( array $options )
$options array

setRenderer() public method

Set a test framework adapter.
public setRenderer ( Mutagenesis\Renderer\RendererInterface $renderer )
$renderer Mutagenesis\Renderer\RendererInterface

setRendererName() public method

Set name of the renderer to use
public setRendererName ( string $rname )
$rname string

setRunkit() public method

Set a custom runkit instance.
public setRunkit ( Runkit $runkit )
$runkit Mutagenesis\Utility\Runkit

setSourceDirectory() public method

Set the source directory of the project being mutated
public setSourceDirectory ( string $dir )
$dir string

setTestDirectory() public method

Set the test directory of the project being mutated
public setTestDirectory ( string $dir )
$dir string

setTimeout() public method

Set timeout in seconds for each test run
public setTimeout ( integer $timeout )
$timeout integer

Property Details

$_adapter protected_oe property

Instance of \Mutagenesis\Adapter\AdapterAbstract linking Mutagenesis to to an underlying test framework to execute tests and parse the test results
protected AdapterAbstract,Mutagenesis\Adapter $_adapter
return Mutagenesis\Adapter\AdapterAbstract

$_adapterConstraint protected_oe property

Adapter constraint. Used in initial run to analyse what tests/cases/suites are to be executed. For example, calling "phpunit MyTests MyTests.php" sets a constraint of "MyTests MyTests.php". Used to narrow the focus of the current mutation testing run if needed (e.g. spreading testing over time)
protected string $_adapterConstraint
return string

$_adapterName protected_oe property

Name of the test adapter, e.g. phpunit, to utilise
protected string $_adapterName
return string

$_adapterOptions protected_oe property

String of adapter options appended to any call to the current adapter's testing utility command (e.g. passing 'AllTests.php' to phpunit)
protected string $_adapterOptions
return string

$_baseDirectory protected_oe property

Path to the base directory of the project being mutated
protected string $_baseDirectory
return string

$_bootstrap protected_oe property

Test framework bootstrap
protected string $_bootstrap
return string

$_cacheDirectory protected_oe property

Path to a cache directory used by library to store working files such as PHPUnit logs needed to analyse test case execution times.
protected string $_cacheDirectory
return string

$_detailCaptures protected_oe property

Flag to add detailed reports (including test results) about the mutations which caused test failures (i.e. captured)
protected bool $_detailCaptures
return boolean

$_generator protected_oe property

Instance of \Mutagenesis\Generator used to generate mutations from the underlying source code
protected Generator,Mutagenesis $_generator
return Mutagenesis\Generator

$_mutables protected_oe property

Stored mutables each containing relevant mutations for the source code being tested
protected array $_mutables
return array

$_options protected_oe property

Generic options, possibly of future use to other test frameworks
protected array $_options
return array

$_renderer protected_oe property

Instance of a suitable renderer used to format results into output
protected Text,Mutagenesis\Renderer $_renderer
return Mutagenesis\Renderer\Text

$_rendererName protected_oe property

Name of the renderer, e.g. text, to utilise
protected string $_rendererName
return string

$_runkit protected_oe property

Instance of \Mutagenesis\Runkit used to apply and reverse mutations on loaded source code within the same process dynamically
protected Runkit,Mutagenesis\Utility $_runkit
return Mutagenesis\Utility\Runkit

$_sourceDirectory protected_oe property

Path to the source directory of the project being mutated
protected string $_sourceDirectory
return string

$_testDirectory protected_oe property

Path to the tests directory of the project being mutated
protected string $_testDirectory
return string

$_timeout protected_oe property

Timeout in seconds allowed per test execution.
protected int $_timeout
return integer