Updated PhpUnit Plugin (markdown)
parent
c52447c1c5
commit
05cc64c37e
|
@ -1,14 +1,16 @@
|
|||
Runs PHPUnit tests against your build.
|
||||
## Configuration
|
||||
### Options
|
||||
Has two modes:
|
||||
|
||||
### With phpunit.xml configuration file
|
||||
#### phpunit.xml Configuration File
|
||||
Its activated if you have phpunit.xml file in your build path, `tests/` subfolder, or you specify it as a parameter:
|
||||
* **config** - Optional - Path to a PHP Unit XML configuration file.
|
||||
* **run_from** - Optional - When running PHPUnit with an XML config, the command is run from this directory
|
||||
* **coverage** - Optional - Value for the `--coverage-html` command line flag.
|
||||
* **path** - Optional - In cases where tests files are in a sub path of the /tests path, allows this path to be set in the config.
|
||||
|
||||
### Running tests in directory by listing it.
|
||||
#### Running Tests By Specifying Directory
|
||||
* **directory** - Optional - The directory (or array of dirs) to run PHPUnit on
|
||||
|
||||
Both modes accept:
|
||||
|
@ -16,7 +18,7 @@ Both modes accept:
|
|||
|
||||
### Examples
|
||||
Specify config file and test directory:
|
||||
```
|
||||
```yml
|
||||
test:
|
||||
php_unit:
|
||||
config:
|
||||
|
@ -24,14 +26,14 @@ test:
|
|||
path: "app/tests/"
|
||||
```
|
||||
|
||||
### Debugging
|
||||
## Troubleshooting
|
||||
If standard logging of PHPCI is not enough, to get standard output from any command, including PHPUnit, edit `BaseCommandExecutor::executeCommand()` to see what exactly is wrong
|
||||
* Run `composer update` in phpunit plugin directory of PHPCI to get all of its dependencies
|
||||
* If phpunit is inside of the project's composer.json, it might interfere with PHPCI's phpunit installation
|
||||
* Make sure you have XDebug installed.`The Xdebug extension is not loaded. No code coverage will be generated.`
|
||||
Otherwise test report parsing in `TapParser` will fail, wanting coverage report as well `Invalid TAP string, number of tests does not match specified test count.`
|
||||
* If you are using xml configuration, make sure you include logging output
|
||||
```
|
||||
```xml
|
||||
<logging>
|
||||
<log type="tap" target="php://stdout"/>
|
||||
<log type="coverage-text" target="php://stdout" showUncoveredFiles="false"/>
|
||||
|
|
Loading…
Reference in a new issue