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

Add functionality to patch functions #35

Merged
merged 2 commits into from
Jul 30, 2015
Merged

Add functionality to patch functions #35

merged 2 commits into from
Jul 30, 2015

Conversation

kenjis
Copy link
Owner

@kenjis kenjis commented Jul 29, 2015

You can mock PHP native functions, if you set $enable_patcher = true:

$this->patchFunction('mt_rand', 100);

or

$this->patchFunction('mt_rand', function($a, $b) {
    return intval(($a + $b) / 2);
});

And if you want to reset mocked functions:

$this->resetFunctionPatches();

kenjis added a commit that referenced this pull request Jul 30, 2015
Add functionality to patch PHP native functions
@kenjis kenjis merged commit 0776eee into master Jul 30, 2015
@kenjis kenjis changed the title Add functionality to patch PHP native functions Add functionality to patch functions Jul 30, 2015
@kenjis
Copy link
Owner Author

kenjis commented Jul 30, 2015

I removed restriction on internal functions: afbcccf

@kenjis kenjis deleted the add-function-patch branch July 30, 2015 09:34
@kenjis
Copy link
Owner Author

kenjis commented Jul 31, 2015

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant