atoum icon indicating copy to clipboard operation
atoum copied to clipboard

Shunt except one

Open flip111 opened this issue 11 years ago • 0 comments

Normally when using a mock i don't want it to call the real methods so for me it would be best if this is the default behavior of the mock. For this reason i always call $this->mockGenerator->shuntParentClassCalls(); but now i like one method enabled. But i noticed that there is no unshunt method on the generator. Is this something that can be added?

Also i noticed that shuntParentClassCalls() is not the same as shuntAll() (a non-existing method at this point). I think this is the related code: https://github.com/atoum/atoum/blob/master/classes/mock/generator.php#L273-L299

For now to shunt all except one i would have to get the list of methods and then iterate over it, maybe it's better to put such functionality inside atoum?

Thoughts ??

flip111 avatar Jun 18 '14 12:06 flip111