News Feed
Sections




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

The PHP.cc Blog:
PHPUnit 4.0 Test Proxies
March 12, 2014 @ 10:13:08

On thePHP.cc blog today there's another post looking at an improvement in the latest release of the popular PHP unit testing tool, PHPUnit 4.0.0. In the post Sebastian Bergmann looks at test proxies.

One of the highlights of PHPUnit 4.0, which was released last week, is improved support for integration testing through so-called test proxies. [...] PHPUnit has had built-in support for stubs and mocks for quite some time. These stubs and mocks can be used in every context where an object of the original class is expected. As it should be, the code of the original class is not executed when a method is called on the stub or mock. [...] PHPUnit 4.0 introduces the concept of test proxies [...] to have an object that provides the same API for expectations as a mock object while at the same time proxying method calls to the original class.

He includes some code examples to help illustrate. He creates a "SimpleWorkflow" class and shows how to test the execution of its "doWork" function to return the correct kind of "Result".

0 comments voice your opinion now!
phpunit test proxy unittest introduction release

Link: http://thephp.cc/viewpoints/blog/2014/03/phpunit-4-0-test-proxies

blog comments powered by Disqus

Similar Posts

Keith Casey's Blog: web2project Status Update: Release Candidate 1

NetTus.com: You Requested It, We Made It: Free PHP Testing Course

Filip de Waard\'s Blog: Stay away from PHP 5.1.3 (for now)

Ilia Alshanetsky\'s Blog: FUDforum 2.7.4RC1 Released

Zend Developer Zone: Zend Framework News 2006/11/29


Community Events





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


release experience code interview list refactor framework introduction language series threedevsandamaybe opinion install podcast community testing laravel symfony2 developer unittest

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