News Feed
Sections




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

Wojciech Sznapka's Blog:
Why Mockery is better than PHPUnit Mock Builder (with Symfony2)
November 02, 2011 @ 13:02:06

Wojciech Sznapka has a new post today sharing his opinions as to why Mockery is better than PHPUnit Mock Builder in testing Symfony2-based applications.

Recently I did a lot of Test Driven Development on my Symfony2 bundle. I used PHPUnit's built-in mocks and stubs for many projects, so I took it again. But while I was working on mocking Symfony2 core objects I found those mocks very uncomfortable in use. I tried Mockery and it saved my day. Let's see how to get it working with Symfony2 and how it kicks ass!

He shows how to get things set up - adding Mockery to the dependencies file (deps), getting the latest version from their git repository and an example mock method that shows the difference in mocking the Doctrine2 entity manager - PHPUnit vs Mockery.

0 comments voice your opinion now!
mockery phpunit mock object unittest


blog comments powered by Disqus

Similar Posts

Lars Tesmer's Blog: How to Unit Test a Class Making Calls to an URL (or the Filesystem) With PHPUnit

Jachim Coudenys: Using multiple databases in phpunit/dbunit with Composer

SitePoint.com: Advanced PHPUnit Testing: Annotations and Mocking

Emran Hasan's Blog: Using Mockery as a mocking framework with PHPUnit

Padraic Brady's Blog: Mocks, Stubs, And SimpleTest Wins


Community Events





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


language laravel threedevsandamaybe interview configure framework developer code community bugfix podcast library series list introduction release application project api wordpress

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