mageekguy/atoum — Issue #50: Unable to test method which use func_get_args() in mocked class 
Author: marmotz
Created: 2012-01-26 15:26:38+00:00
State: open

I have a class with a method without parameter in declaration but which use func_get_args():

```PHP
class MyClass {
public function myMethod() {
$args = func_get_args();
// ...
}
}
```

In my tests, i create a mock of this class and want to test this method. But the generate code is:
```PHP
class MyClass extends atoum\test {
public function testMyMethod() {
$this->mockTestedClass();
$myClass = new \mock\MyClass;

$this->assert()
->string($myClass->myMethod('foo'))
->isEqualTo('bar')
}
}
```
This test fail because myMethod never receive parameter.

In mageekguy\atoum\mock\generator::getMockedClassCode(), here is the generated code:
```PHP
// ...snip...
public function myMethod()
{
if (isset($this->getMockController()->myMethod) === true)
{
return $this->mockController->invoke('myMethod', array());
}
else
{
$this->getMockController()->addCall('myMethod', array());
return parent::myMethod();
}
}
// ...snip...
```