News Feed
Sections




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

Sebastian Bergmann's Blog:
Visualizing Text Differences in PHPUnit 3
August 23, 2006 @ 10:36:32

Sebastian Bergmann has posted this new item on his blog today detailing how to tell the differences between two strings inside of PHPUnit 3.

A long-standing feature request for PHPUnit has been the generation of a real diff between strings that span multiple lines.

Ideally this would be done by implementing the diff algorithm in PHP. But since Derick needed a working solution quickly, the two of us came up with a "hack": we just use GNU diff and invoke the diff command via shell_exec().

He gives an example, showing how to judge the difference between two strings of HTML in a test. The result catches the differences (inside the body tags) easily.

0 comments voice your opinion now!
visualize text difference phpunit test diff visualize text difference phpunit test diff


blog comments powered by Disqus

Similar Posts

Ilia Alshanetsky's Blog: 5.2.2RC1 Released for Testing

Brandon Savage: Effective Refactoring Strategies

Michelangelo van Dam's Blog: Quality Assurance on PHP projects - PHPUnit part 4

Ilia Alshanetsky's Blog: 5.2.1RC2 Available for Testing

Sebastian Bergmann's Blog: Distributed Testing with PHPUnit 3.1


Community Events





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


deployment tips interview community opinion introduction release language list zendserver symfony library podcast update laravel package framework install api series

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