How to write unit tests in PHP

Writing unit tests is all about writing down the behavior of the code that we want to test. Once the unit test is written it gets locked and the actual code should fulfill these steps of behaviors in the specified order. Writing unit tests makes the developer stick to what is instructed in the test