Skip to content

Commit

Permalink
Merge pull request #44 from elecena/code-coverage
Browse files Browse the repository at this point in the history
Add code coverage
  • Loading branch information
macbre authored Jun 25, 2021
2 parents b29e85e + 899db0a commit a243422
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -72,4 +72,4 @@ jobs:
composer install --no-interaction
- name: Test the code
run: composer run test
run: composer run coverage
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ composer.phar
*.swp

.coverage/
.coverage.xml
.phpunit.result.cache

vendor/
Expand Down
2 changes: 2 additions & 0 deletions classes/NanoBaseTest.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@

/**
* Base class for PHPUnit-based unit tests
*
* @codeCoverageIgnore
*/
class NanoBaseTest extends TestCase
{
Expand Down
2 changes: 2 additions & 0 deletions classes/NanoConsole.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
/**
* Nano console handler
*
* @codeCoverageIgnore
*
* TODO: handle catchable fatals @see http://stackoverflow.com/questions/2468487/how-can-i-catch-a-catchable-fatal-error-on-php-type-hinting
*/
class NanoConsole
Expand Down
2 changes: 2 additions & 0 deletions classes/NanoScript.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@

/**
* General interface for CLI scripts
*
* @codeCoverageIgnore
*/
abstract class NanoScript extends NanoObject
{
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
"phpunit"
],
"coverage": [
"phpunit --coverage-html=.coverage"
"XDEBUG_MODE=coverage phpunit --coverage-html=.coverage --coverage-clover=.coverage.xml --coverage-text"
],
"lint": [
"php-cs-fixer fix --config=.php-cs-fixer.php --dry-run --verbose",
Expand Down

0 comments on commit a243422

Please sign in to comment.