blakeembrey / code-problems

Common code and interview problems solved in multiple languages
MIT License
3.81k stars 509 forks source link

add PHPUNIT test suites #176

Closed caoglish closed 7 years ago

caoglish commented 7 years ago

add PHPUNIT test suites and PHPUNIT config files so that the project can unit test the php code.

composer install vendor/bin/phpunit

If you have already install phpunit globally, just run:

phunit

blakeembrey commented 7 years ago

Awesome, cheers! Do you think we should add some docs for this and/or update the npm test script to run both JS and PHP test suites?

caoglish commented 7 years ago

Yes, I am trying to do this.

However if only add && PHPUnit in the test section, anything failed will cause test stopped. Also, PHPUnit need to be install globally.

Also if add && vendor/bin/phpunit, this will not run on windows.

Right now this is the issue. we need to think way avoid this.

Anyway, we can make PHPUnit works then solve this issue.