This is a simple bootstrap project for PHP with PHPUnit.
The kata uses:
Recommended:
Clone the repository:
git clone [email protected]:swkBerlin/kata-bootstraps.git
or
git clone https://github.com/swkBerlin/kata-bootstraps.git
Install all the dependencies using composer:
cd kata-bootstraps/php
composer install
Run the passing test:
composer test -- --filter testNotFailing
The kata uses composer to install:
- PHPUnit v10, which requires PHP 8.1+ (See Legacy PHP below for other PHP options)
src
- contains the Kata classes, which is a basic starter code.tests
- contains a passing and failing test for the Kata class, which is a starter test.
PHPUnit is pre-configured to run tests. PHPUnit can be run using a composer script. To run the unit tests, from the root of the PHP kata run:
composer test
A shell script to start docker has been provided:
test.sh
If you have legacy version of PHP please change composer.json file and include the version that is compatible with you version of PHP, also change PHPUnit to a supported Version.
If you change the PHPUnit version do not forget to run:
composer update --with-dependencies
Happy coding!