Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/rudifa/phpunit-simple-example
phpunit-simple-example
https://github.com/rudifa/phpunit-simple-example
Last synced: 14 days ago
JSON representation
phpunit-simple-example
- Host: GitHub
- URL: https://github.com/rudifa/phpunit-simple-example
- Owner: rudifa
- Created: 2023-01-18T21:45:33.000Z (about 2 years ago)
- Default Branch: master
- Last Pushed: 2023-01-18T21:48:22.000Z (about 2 years ago)
- Last Synced: 2024-12-14T15:27:14.305Z (2 months ago)
- Language: PHP
- Size: 31.3 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: readme.md
Awesome Lists containing this project
README
A Simple PHPUnit Example
========================This is a simple example of unit testing in PHP with PHPUnit. I used these examples as part of a talk given at Sheffield PHP on the 18th January 2018. The talk has been written up as a blog post: [PHPUnit: What, Why, How?](https://andy-carter.com/blog/phpunit-what-why-how).
Please feel free to download this repository and give the unit tests a try.
As mentioned in my blog post try adding a second test case for the `Average::median` method to test when an even set of numbers is passed to the method.
If you succeed at that, then try taking a test driven development approach to adding a new method to `Average` for calculating the modal average by writing a test first.
Getting Started
---------------Clone this repository and then run Composer:-
```
composer install
```You will then be able to run the unit tests using:-
```
./vendor/bin/phpunit
```