Pavel Shevaev wrote:
>> (Just thinking out loud.) Another way of designing
it would be to let
>> the test case be the factory for the mock objects:
>>
>> class SomeTest extends UnitTestCase {
>> function __construct() {
>> parent::UnitTestCase();
>> $this->mock =
$this->newMockObject('MockBar');
>> }
>>
>>
>
> I remember Marcus wanted to add something like that but
a bit more
> magical(via __get):
>
> $this->mock = $this->MockBar;
>
>
I looked up that discussion, and I think my intent is
different and less
ambitous. I'm talking about way to construct objects that
let you choose
flexibility or simplicity. And I think in general the way to
do that in
PHP (5) is to keep the constructor flexible and add
simplified
construction in creation methods or factories.
------------------------------------------------------------
-------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and
take
control of your XML. No limits. Just data. Click to get it
now.
http://sourcefor
ge.net/powerbar/db2/
_______________________________________________
Simpletest-support mailing list
Simpletest-support lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/simp
letest-support
|