News Feed
Jobs Feed
Sections




Recent Jobs

News Archive
Benjamin Eberlei's Blog:
Test your Legacy PHP Application with Function Mocks!
March 31, 2009 @ 11:18:31

Benjamin Eberlei has a suggestion for testing your application without having to mess around with creating new resources just for testing - use mocks.

Much talking is going on about Unit testing, Mocks and TDD in the PHP world. For the most this discussions surround object-oriented PHP code, frameworks and applications. Yet I would assert that the reality for PHP developers (me included) is dealing with PHP 4, PHP 5 migrated, or non-object oriented legacy applications which are near to impossible to bring under test.

He includes a "proof of concept" for a replacement mysql_query function (as created inside of Runkit) that sets up a "mocker" object that returns a "hello world" message when the mysql_query function is called.

0 comments voice your opinion now!
mock function runkit proofofconcept mysqlquery resource



Similar Posts

Sara Golemon's Blog: PHP6: News from the front...

Ilia Alshanetsky's Blog: mail() logging for PHP

DevShed: The Destruct Magic Function in PHP 5

PHPClasses.org: PHP User Submitted Book Reviews

Zend Developer Zone: Accessing DB2 Data Inside of i5/OS


Community Events









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


podcast symfony wordpress sqlserver extension performance zendframework framework drupal microsoft opinion developer feature job conference zend release codeigniter facebook windows

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