Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support Mockito Syntax for Mocking and Stubbing #5

Open
sebastianheuer opened this issue Oct 7, 2014 · 0 comments
Open

Support Mockito Syntax for Mocking and Stubbing #5

sebastianheuer opened this issue Oct 7, 2014 · 0 comments
Assignees
Milestone

Comments

@sebastianheuer
Copy link
Owner

In Mockito, you can do this:

when(mock.doFoo()).thenReturn("bar");

This syntax should be supported by Mokka (if that is possible in PHP at all).

Mokka::when($mock->doFoo())->thenReturn('bar');

The tricky part is to pass $mock->doFoo() to Mokka::when() as a callable.

@sebastianheuer sebastianheuer added this to the 1.0 milestone Oct 7, 2014
@sebastianheuer sebastianheuer self-assigned this Oct 7, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant