logo       
Google Custom Search
    AddThis Social Bookmark Button
-->

Re: Mocking with proper inheritance: msg#00040

Subject: Re: Mocking with proper inheritance
Travis Swicegood wrote:

> Considering that you are creating a Mock object, wouldn't it be
> prudent to mock all public methods and use the method array() to
> specify which methods to not override?  I would personally find that
> more useful in a situation where type hinting was used against a
> direct class.  This would keep from allowing "behavior leak".

I have worked on this some weeks ago. It works now for me. As of now the
mock class extends its original and all methods are overridden. a
whitelist for methods that shouldn't be overriden would be easy to
implement. The bigger problem is with PHP 4 compatibility - I have no
PHP4 installed anywhere and I didn't code something in PHP4 in the last
year or so  ...

I haven't unit tested it though it runs in several tests of my own - at
the moment I think of it more like an intermediate solution until Marcus
implements it for a later version of simpletest

yours
Roman


-------------------------------------------------------
SF.Net email is Sponsored by the Better Software Conference & EXPO
September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices
Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA
Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf


<Prev in Thread] Current Thread [Next in Thread>