Hi,
I like to check results form method calls that are
supposed to return an object with "is_a". However, when
I use a partial mocked object to return a mock object,
the mock-object extends SimpleMock, not the mock base
class.
Any easy way to implement that?
Jochen
Logged In: YES
user_id=695819
Hi.
Not in PHP4. The partial mock sactually do inherit from
their original class of course, its the conventional mocks
that do not. This is deliberate. The original classes may
not have been written yet, or the constructors could have
side effects, or other functionality may leak through via
__get() type operations. I'd rather avoid the original base
class for mocks.
For PHP5 the mocks and partial mocks will implement any
interfaces they find in theoriginal class. This allows them
to work with type hinting and the like.
I have to ask, should you really be checking return types
with is_a()? Seem you are trying to emulate that other langauge.
yours, Marcus
Logged In: YES
user_id=695819
Hi.
Just a nag message. Have I understood the problem correctly?
yours, Marcus
Logged In: YES
user_id=695819
Hi.
I'd like to close this one for now, mainly because I don't
understand it.
yours, Marcus