You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There are unit tests stored within the test directory, along with a phpunit.xml.
The file at .github/workflows/ci.yml shows how to use php-actions/phpunit - take note of the uses: php-actions/phpunit@v9 line.
Versions of PHPUnit and all options are available to configure. Please see the php-actions/phpunit documentation for more information!
Functionality
There are two classes in this example project; Greeter and EnvGreeter, in the src/ directory, which are tested in the test/ directory.
The Greeter has a function, greet() which takes an optional name. Without providing a name, the Greeter will return "Hello!", otherwise it will include the provided name, like "Hello, Example!".
The EnvGreeter extends Greeter and provides a new function, greetFromEnv(), which takes the name of an environment variable to load the name from.
The GitHub Action tests are executed in the ci.yml file where the TEST_NAME environment variable is declared, along with any other PHPUnit configuration.
Click the Actions tab at the top of this repository to view the latest test runs.