hafriedlander/phockito — pull request #14 by drdamour (2013-06-12 19:57:42+00:00)
Title: Mocking return byRef methods

Ran into an issue when mocking a byRef parameter...to me PHP might have a bug here.

If a class has a return byRef method (ie public function &Foo()) then derived classes can override Foo without byRef (ie public function Foo()).

Phockito wasn't ensuring the derived was byRef, i wrote a test around this to ensure it is. Maybe this should be optional..by ref is darn weird.

but...
If a class has a return byRef method (ie public function &Foo()) that comes from an interface then derived classes MUST override with the return ByRef. Different behaviour in PHP..might be a bug

Anyways i added tests for this too.

The implementation was very simple