|
From: Perrick P. <pe...@no...> - 2008-09-03 08:14:41
|
The FAQ is next on my personal TODO list. And such response will be
really useful.
Thanks !
Perrick
Dagfinn Reiersøl wrote:
> todd runstein wrote:
>> I'm looking for a way to make my mock object throw an exception. I want to
>> test that my class under test catches and handles any thrown exceptions
>> correctly. I want to add a call to my mock object similar to:
>>
>> $this->mymock->setReturnValue('doomedmethod', new Exception('thanks'));
>>
>> Or even better:
>> $this->mymock->expectAndThrow('doomedmethod', new Exception('thanks'));
>>
>> Any advice on whether this exists in simpletest? If not, is there any other
>> way to test my classes exception handling logic?
>>
>> Thanks,
>>
>> Todd
>>
>>
> You can decorate the mock object as I explain in my response to this thread:
>
> *http://tinyurl.com/5n9w4l*
>
> -------------------------------------------------------------------------
> This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
> Build the coolest Linux based applications with Moblin SDK & win great prizes
> Grand prize is a trip for two to an Open Source event anywhere in the world
> http://moblin-contest.org/redirect.php?banner_id=100&url=/
> _______________________________________________
> Simpletest-support mailing list
> Sim...@li...
> https://lists.sourceforge.net/lists/listinfo/simpletest-support
>
>
|