Skip to content

Latest commit

 

History

History
 
 

php

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 

PHPUnit setup

This is a simple bootstrap project for PHP with PHPUnit.

Installation

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

Dependencies

The kata uses composer to install:

  • PHPUnit v10, which requires PHP 8.1+ (See Legacy PHP below for other PHP options)

Folders

  • 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.

Testing

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

Run from docker

A shell script to start docker has been provided:

test.sh

Legacy

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!