This package is called as JUnit which is for Java developers. The standard
and testing style maintained in JUnit is usually followed in many other unit testing
packages. So JUnit has become a defacto in the unit testing area. The port of JUnit
for PHP developers is known as PHPUnit, which was developed by Sebastian
Bergmann. PHPUnit is a very popular unit testing package.
One of the main reasons for writing unit tests is that you cannot figure out all the
bugs if you just write your code and deploy your application. There might be small
bugs that might crash your application violently by returning a non relevant value.
Don't overlook these small scenarios. There might be cases when you wouldn't
imagine one of your codes returning an extremely odd result. Unit testing helps you
by writing different test cases. Unit testing is not a thing which needs a lot of time to
write, however the outcome is amazing.
In the following section we will learn the basics of unit testing, and get our hands
dirty writing successful unit tests.
Chapter 5
[ 111 ]
Benefits of Unit Testing
Unit testing has a lot of benefits, some of them are that it:
Ensures the consistency of your application.
Pages:
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126