This post originated from an RSS feed registered with PHP Buzz
by Mike Naberezny.
Original Post: Wrapping PHP Functions for Testability
Feed Title: MikeNaberezny.com
Feed URL: http://mikenaberezny.com/category/php/feed/
Feed Description: Mike Naberezny blogs about PHP tricks, better PHP programming, test driven development, and other dynamic language topics.
One of the problems that hampers the testability of PHP code is the coupling created by accessing all of the PHP global functions. This happens often because a large number of useful extensions are accessed only through global functions. Consider the following code snippet:
$res = ldap_connect($host, $port);
if (! ...