News Feed
Sections




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

SitePoint.com:
Be More Asssertive Getting to Know PHPUnit's Assertions
January 20, 2011 @ 13:32:28

On SitePoint.com today there's a new article, the second in the series, introducing unit testing in PHP with PHPUnit. The first article can be found here. (Disclaimer: I am the author of this series of articles).

In my previous article, I took you through some of the basics of unit testing with PHPUnit. I introduced you to what it means to test your code and the real benefits it can for you and your code. This time I want to dive in a little deeper and get to know PHPUnit in a bit more detail.

The tutorial goes into more detail on some of the commonly used assertion methods PHPUnit has to offer including: assertTrue, assertLessThanOrEqual, assertStringStartsWith, assertSame and assertClassHasAttribute. There's also a brief discussion about marking tests incomplete or skipped and how, except in some circumstances, it should be avoided at all costs.

0 comments voice your opinion now!
phpunit assertions unittest tutorial


blog comments powered by Disqus

Similar Posts

Sebastian Bergmann\'s Blog: Graphical Logging in PHPUnit 3

Sebastian Bergmann's Blog: Testing Code That Uses Singletons

SitePoint PHP Blog: Basic TDD in Your New PHP Package

SitePoint Web Foundations Blog: Quick Tip: Install Zend Server 7 on an Ubuntu 14.04 Vagrant Box

WebMonkey: Get Your Feet Wet with WordPress


Community Events

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


threedevsandamaybe library interview series framework voicesoftheelephpant extension laravel api podcast community laravel5 unittest wordpress opinion development feature language release introduction

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