Skip to content

Commit

Permalink
feat: Add phpunit config file in order to show test coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
Manuel Canga committed Sep 14, 2024
1 parent d8e8ae9 commit db1fb6a
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/php.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,4 +34,4 @@ jobs:
run: composer install -q --no-ansi --no-interaction --no-scripts --no-progress --prefer-dist

- name: Execute tests (Smoking Tests and unit tests) via PHPUnit
run: vendor/bin/phpunit --bootstrap tests/bootstrap.php tests --testdox --coverage-text tests
run: vendor/bin/phpunit --testdox --coverage-text
27 changes: 27 additions & 0 deletions phpunit.xml.dist
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- https://phpunit.readthedocs.io/en/latest/configuration.html -->
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/10.1/phpunit.xsd" backupGlobals="false" colors="true"
bootstrap="tests/bootstrap.php">
<php>
<ini name="display_errors" value="1"/>
<ini name="error_reporting" value="-1"/>
<server name="SHELL_VERBOSITY" value="-1"/>
</php>
<testsuites>
<testsuite name="Project Test Suite">
<directory>tests</directory>
</testsuite>
</testsuites>
<include>
<directory suffix=".php">trunk/src</directory>
</include>
<source>
<include>
<directory suffix=".php">trunk/src</directory>
</include>
<include>
<directory suffix=".php">trunk/config</directory>
</include>
</source>
</phpunit>
2 changes: 1 addition & 1 deletion tests/bootstrap.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,4 @@

${'display-metadata'} = $plugin_services['plugin'](base_dir: $plugin_dir, services: $plugin_services);

// Throw tests with vendor/bin/phpunit --bootstrap tests/bootstrap.php tests
// Throw tests with vendor/bin/phpunit --testdox

0 comments on commit db1fb6a

Please sign in to comment.