The discussion starts with testing because it precedes debugging in the software development life cycle. PHP provides a unit-testing system, which is known as PHPUnit.
If you use PHPUnit, you gain the freedom to write some code and to check some code. Yes, you read it right. You can use PHPUnit to write some program that will check the input and output of some other program. Interesting phenomenon, right?
When you can write an application (PHP code) using an application (PhpStorm), why not test the application (PHP code) with an application (PHPUnit test cases)? Since PHPUnit is just an application written in PHP, it is available in the form of a PHP Archive (PHAR). It is just a method to ship your files and folders as a whole and to make it ready to be executed.