iNET Interactive - Online Advertising Agency
          
   Home    Authors    About    Login    Contact Us
   Search:   
Advanced Search     
  Articles

  ASP (26)
  ASP.NET (19)
  C and C++ (4)
  CFML (2)
  CGI and Perl (16)
  Flash (2)
  Java (7)
  JavaScript (28)
  PHP (92)
  MySQL (13)
  MSSQL (3)
  HTML (34)
  SEO (9)
  Visual Basic (12)
  CSS (13)
  SSI (5)
  XML (12)
  C# (14)

  Developer News

May 13, 2008
Rainbow Links
EarthWeb.com
 
May 13, 2008
MySpace Profile Page Resources
HTML Goodies
 
May 13, 2008
How to Upload Your Photos onto the Web
HTML Goodies
 
May 13, 2008
Email Marketing for MySpace Artists
HTML Goodies
 
May 13, 2008
Top Online Marketing Techniques
HTML Goodies
 
May 13, 2008
I want to create a site just like ____, is that a violation of...
About
 
Courtesy of moreover.com
 
Want to receive new articles via e-mail? Click here!
/Home /PHP

UnitTesting in PHP using SimpleTest 

  Views:    32461
  Votes:    6
by Saleh Jamal 5/15/05 Rating: 

Synopsis:

Unit testing is writing more code which will test the main code wirtten by "throwing" sample data at it and examining what it gets back.
Pages: firstback1 2 3 4 5 6 forwardlast
The Article

Conclusion

Now after all this effort, you might ask: "Why bother writing all these tests?" I tell you it's much better than debugging with nasty ways such as var_dump()'s and difficult investigations to find if there were any typos or null statments or whatever might be causing the problem. With unit testing, the test case will report were exactly is the problem.
With unit testing, if you ever change your class implementation, all you have to do is run the test case and it will report if everything is functioning correctly or not and give details about any failures, if any.
Another advantage is that you are separating the debugging code from the original code! No need to clean up after debugging or anything.

A final remark, SimpleTest has great potential and many other features like mock objects and web tester which could make your debugging process easier than ever! for example, the web tester can navigate your website, follow links, click buttons, submit forms and much more!
In this article, we were demonstrating the most basic use of unit testing. It is just a kick off to infect you with the Test-infection :D
If you want to learn more about this great framework, read the docs at LastCraft.
Pages: firstback1 2 3 4 5 6 forwardlast

Similar/related articles:


 
  Sponsors