It's been developed on window 10 , PHP Version 7.4.7 & PHPUnit 9.5.20
Solution has mainly 3 below files
- src\StrCal.php
- tests\StrCalTest.php
- composer.json
For simplicity max number allowed is 100, which can be changed by
changes const MAX_NUMBER_ALLOWED = 100;
in StrCal.php
file.
First, you need to install composer dependencies.
composer.phar install
Or Update composer dependencies.
composer update
Run test cases
vendor\bin\phpunit tests
Nine unit tests have been wrote, you can find it in tests
directory.
You can also run them via console command.
vendor\bin\phpunit tests
PHPUnit 9.5.20 #StandWithUkraine
......... 9 / 9 (100%)
Time: 00:00.032, Memory: 4.00 MB
OK (9 tests, 9 assertions)
screenshots of the command line output of working code includeed as a jpg in the screenshots
repository