Sample project to write PHP automated tests.
- PHP 7+
Clone this repository:
$> git clone https://github.com/MediaComem/comem-archidep-php-automated-tests
Run the script:
$> cd comem-archidep-php-automated-tests
$> php file-stats.php data/rainbow.txt
File: /path/to/data/rainbow.txt
Lines: 51
Words: 255
Characters: 1284
Size: 1.25KB
$> php file-stats.php data/japanese.txt
File: /path/to/data/japanese.txt
Lines: 2
Words: 6
Characters: 12
Size: 22B
- Install PHPUnit.
- Write at least one unit test per function.
- Write an integration test for
countBytes
andformatBytes
together.