|
From: Jason S. <jsw...@ya...> - 2004-02-08 00:19:54
|
--- Marcus Baker <ma...@la...> wrote:
> Hi...
>
> Jason Sweat wrote:
> > Would it be reasonable to automatically wrap the third argument in an
> array, if
> > it is not an array, to avoid this error?
>
> I thought about this, but could not come to a final conclusion and so
> went with simplicity. The problem with overloaded arguments is that you
> have more stuff to explain in the documentation and more things to
> figure out in use. At least this way it always behaves the same way...
>
> $mock->expectArguments('method', $login->getPermissions());
>
> What if the method sometimes returns false and sometimes an array? Not a
> likely scenario, but you kind of see what I mean. If I were going to go
> that way I should have used the func_get_args() to have them flat.
> Perhaps I should have done that :(.
Well, I think we should at least detect if an array was supplied, and fail the
test if something other than an array was provided rather than letting the test
have a php error for invalid argument to the foreach.
I'll look into possible fixing that tonight.
__________________________________
Do you Yahoo!?
Yahoo! Finance: Get your refund fast by filing online.
http://taxes.yahoo.com/filing.html
|