phpspec/phpspec2 — pull request #93 by karolsojko (2013-01-03 23:10:15+00:00)
Title: Fixed failing method calling on mock prophets

If I've got a class like this

```php
class Foo()
{
protected $bar;

public function bar() { ... }
}
```
I know this isn't a best practice to name methods exactly the same as properties but this is what f.e. Propel has in one of it's core query building class.

So if you make a mock of this class

```php
$fooMock->beAMockOf('\Foo');
$fooMock->bar()->willReturn(true);
```
and run your specs you will get an access violation error saying that you're trying to access a protected property bar (note that you were calling a method not accessing a property).

This happens due to how ```MockProphet``` handles method calling:
```php
//...
return call_user_func_array($this->$method, $arguments);
```