6.1 KiB
6.1 KiB
Testing Tasks
Atoum
Runs atoum tests
<?php
$this->taskAtoum()
->files('path/to/test.php')
->configFile('config/dev.php')
->run()
?>
tags($tags)Tag or Tags to filter.lightReport()Display result using the light reporter.tap()Display result using the tap reporter.bootstrap($file)Path to the bootstrap file.configFile($file)Path to the config file.debug()Use atoum's debug mode.files($files)Test file or test files to run.directories($directories)Test directory or directories to run.dir($dir)Changes working directory of commandprinted($arg)Should command output be printedarg($arg)Pass argument to executable. Its value will be automatically escaped.args($args)Pass methods parameters as arguments to executable. Argument valuesrawArg($arg)Pass the provided string in its raw (as provided) form as an argument to executable.option($option, $value = null)Pass option to executable. Options are prefixed with--, value can be provided in second parameter.optionList($option, $value = null)Pass multiple options to executable. Value can be a string or array.
Behat
Executes Behat tests
<?php
$this->taskBehat()
->format('pretty')
->noInteraction()
->run();
?>
stopOnFail()*return$thisnoInteraction()*return$thisconfig($config_file)*param$config_filecolors()*return$thisnoColors()*return$thissuite($suite)*param string$suiteverbose($level = null)*param string$levelformat($formater)*param string$formaterdir($dir)Changes working directory of commandprinted($arg)Should command output be printedarg($arg)Pass argument to executable. Its value will be automatically escaped.args($args)Pass methods parameters as arguments to executable. Argument valuesrawArg($arg)Pass the provided string in its raw (as provided) form as an argument to executable.option($option, $value = null)Pass option to executable. Options are prefixed with--, value can be provided in second parameter.optionList($option, $value = null)Pass multiple options to executable. Value can be a string or array.
Codecept
Executes Codeception tests
<?php
// config
$this->taskCodecept()
->suite('acceptance')
->env('chrome')
->group('admin')
->xml()
->html()
->run();
?>
suite($suite)*param string$suitetest($testName)*param string$testNamegroup($group)set group option. Can be called multiple timesexcludeGroup($group)*param string$groupjson($file = null)generate json reportxml($file = null)generate xml JUnit reporthtml($dir = null)Generate html reporttap($file = null)generate tap reportconfigFile($file)provides config file other then defaultcodeception.ymlwith-coptioncoverage($cov = null)collect codecoverage in raw format. You may pass name of cov file to save resultssilent()execute in silent modecoverageXml($xml = null)collect code coverage in xml format. You may pass name of xml file to save resultscoverageHtml($html = null)collect code coverage and generate html report. You may passenv($env)*param string$envdebug()*return$thisdir($dir)Changes working directory of commandprinted($arg)Should command output be printedarg($arg)Pass argument to executable. Its value will be automatically escaped.args($args)Pass methods parameters as arguments to executable. Argument valuesrawArg($arg)Pass the provided string in its raw (as provided) form as an argument to executable.option($option, $value = null)Pass option to executable. Options are prefixed with--, value can be provided in second parameter.optionList($option, $value = null)Pass multiple options to executable. Value can be a string or array.
PHPUnit
Runs PHPUnit tests
<?php
$this->taskPHPUnit()
->group('core')
->bootstrap('test/bootstrap.php')
->run()
?>
filter($filter)*param string$filtergroup($group)*param string$groupexcludeGroup($group)*param string$groupjson($file = null)addslog-jsonoption to runnerxml($file = null)addslog-junitoptiontap($file = null)*param string$filebootstrap($file)*param string$fileconfigFile($file)*param string$filedebug()*return$thisfiles($files)Directory of test files or single test file to run.file($file)Test the provided file.dir($dir)Changes working directory of commandprinted($arg)Should command output be printedarg($arg)Pass argument to executable. Its value will be automatically escaped.args($args)Pass methods parameters as arguments to executable. Argument valuesrawArg($arg)Pass the provided string in its raw (as provided) form as an argument to executable.option($option, $value = null)Pass option to executable. Options are prefixed with--, value can be provided in second parameter.optionList($option, $value = null)Pass multiple options to executable. Value can be a string or array.
Phpspec
Executes Phpspec tests
<?php
$this->taskPhpspec()
->format('pretty')
->noInteraction()
->run();
?>
stopOnFail()noCodeGeneration()quiet()verbose($level = null)noAnsi()noInteraction()config($config_file)format($formater)dir($dir)Changes working directory of commandprinted($arg)Should command output be printedarg($arg)Pass argument to executable. Its value will be automatically escaped.args($args)Pass methods parameters as arguments to executable. Argument valuesrawArg($arg)Pass the provided string in its raw (as provided) form as an argument to executable.option($option, $value = null)Pass option to executable. Options are prefixed with--, value can be provided in second parameter.optionList($option, $value = null)Pass multiple options to executable. Value can be a string or array.