Skip to content

Commit e9f1011

Browse files
Added info for running unit-tests & coverage
Added Jenkins and CLI unit-test & coverage information
1 parent ae3ab74 commit e9f1011

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

README.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,25 @@ PHP7
1414

1515
`composer require lewiscowles/ulid`
1616

17+
## Tests:
18+
19+
To generate the coverage report xdebug extension must be enabled for your PHP
20+
21+
### CLI
22+
23+
`php vendor/bin/phpunit --coverage-html ./reports/ --whitelist src`
24+
25+
### Jenkins pipeline step for testing
26+
27+
```Groovy
28+
stage('Run Unit Tests in PHP') {
29+
dir('ulid') {
30+
sh 'php vendor/bin/phpunit --coverage-html ./reports/ --whitelist src'
31+
}
32+
publishHTML([allowMissing: true, alwaysLinkToLastBuild: false, keepAll: true, reportDir: 'ulid/reports', reportFiles: 'index.html', reportName: 'PHPUnit Coverage'])
33+
}
34+
```
35+
1736
## Got an idea?
1837

1938
Create an issue, a PR, both (if possible) :smile_cat:

0 commit comments

Comments
 (0)