List Info

Thread: Re: Better handling of "Call to a member function tell() on a non-object ...mo




Re: Better handling of "Call to a member function tell() on a non-object ...mo
user name
2007-06-27 02:21:35
> (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;

-- 
Best regards, Pavel

------------------------------------------------------------
-------------
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-supportlists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/simp
letest-support

Re: Better handling of "Call to a member function tell() on a non-object ...mo
country flaguser name
Norway
2007-06-27 02:36:45
Pavel Shevaev wrote:
> I remember Marcus wanted to add something like that but
a bit more
> magical(via __get):
>
> $this->mock = $this->MockBar;
Yeah, that's conceptually the same thing with more or
different 
syntactic sugar. I haven't been following all the
discussions here closely.

------------------------------------------------------------
-------------
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-supportlists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/simp
letest-support

Re: Better handling of "Call to a member function tell() on a non-object ...mo
country flaguser name
Norway
2007-06-27 02:54:45
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-supportlists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/simp
letest-support

[1-3]

about | contact  Other archives ( Real Estate discussion Medical topics )