News Feed
Sections




News Archive
Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

PHPMaster.com:
Getting Started with PHPUnit
November 15, 2011 @ 08:25:49

On PHPMaster.com today, there's a new tutorial helping you get started with on of the most popular unit testing frameworks for PHP, PHPUnit. In this new article they help you write your first tests, run them and figure out what to do when they fail.

Most people know that testing your websites is a good idea, but after some time testing can become tedious. What if a lot of this testing process could be automated so you don't have to go trough every function manually, time after time, to ensure that it still works after updating your code? This is where unit testing comes in, to automate the testing process.

She starts with a simple, self-contained test - setting and getting a "name" value from a User class. The tests include an example of a setup/tear down and check that the result of the "talk()" method is correct with an assertEquals.

0 comments voice your opinion now!
phpunit unittest introduction sample


blog comments powered by Disqus

Similar Posts

php|architect\'s ART: JSON and PHP - More Than Web Services

Sebastian Bergmann's Blog: The Cost of Test Isolation (and other PHPUnit Features)

Matthew Weier O'Phinney's Blog: Getting started writing ZF2 modules

Community News: PHPUnit 3.2 Released

MongoDB Blog: MongoDB for the PHP Mind, Part 1


Community Events





Don't see your event here?
Let us know!


community testing threedevsandamaybe release interview language framework developer refactor introduction list symfony2 laravel podcast experience install code unittest opinion series

All content copyright, 2014 PHPDeveloper.org :: info@phpdeveloper.org - Powered by the Solar PHP Framework