You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+4-4Lines changed: 4 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -90,7 +90,7 @@ This patcher allows replacement of global functions that can't be mocked by PHPU
90
90
91
91
But it has a few limitations. Some functions can't be replaced and it might cause errors.
92
92
93
-
So by default we can replace only a dozen pre-defined functions in [FunctionPatcher](https://github.com/kenjis/ci-phpunit-test/blob/a4f8ceb4b96650529565be23a77f5dfcda8d4cce/application/tests/_ci_phpunit_test/patcher/3.x/Patcher/FunctionPatcher.php#L27-L44).
93
+
So by default we can replace only a dozen pre-defined functions in [FunctionPatcher](https://github.com/kenjis/monkey-patch/blob/a11e1f227234dadeae2460d29b9c8ca6e91c88de/src/Patcher/FunctionPatcher.php#L31-L49).
94
94
95
95
~~~php
96
96
public function test_index()
@@ -103,7 +103,7 @@ So by default we can replace only a dozen pre-defined functions in [FunctionPatc
103
103
}
104
104
~~~
105
105
106
-
[MonkeyPatch::patchFunction()]() replaces PHP native function `mt_rand()` in `Welcome::index` method, and it will return `100` in the test method.
106
+
`MonkeyPatch::patchFunction()` replaces PHP native function `mt_rand()` in `Welcome::index` method, and it will return `100` in the test method.
107
107
108
108
**Note:** If you call `MonkeyPatch::patchFunction()` without 3rd argument, all the functions (located in `include_paths` and not in `exclude_paths`) called in the test method will be replaced. So, for example, a function in CodeIgniter code might be replaced and it results in unexpected outcome.
109
109
@@ -138,7 +138,7 @@ You could change return value of patched function using PHP closure:
138
138
139
139
#### Patch Other Functions
140
140
141
-
If you want to patch other functions, you can add them to [functions_to_patch](https://github.com/kenjis/ci-phpunit-test/blob/a4f8ceb4b96650529565be23a77f5dfcda8d4cce/application/tests/Bootstrap.php#L369-L371) in `MonkeyPatchManager::init()`.
141
+
If you want to patch other functions, you can add them to [functions_to_patch](hhttps://github.com/kenjis/monkey-patch/blob/a11e1f227234dadeae2460d29b9c8ca6e91c88de/src/bootstrap.php#L56-L59) in `MonkeyPatchManager::init()`.
142
142
143
143
But there are a few known limitations:
144
144
@@ -180,7 +180,7 @@ This patcher allows replacement of constant value.
180
180
}
181
181
~~~
182
182
183
-
[MonkeyPatch::patchConstant()]() replaces the return value of the constant `ENVIRONMENT` in `Welcome::index` method.
183
+
``MonkeyPatch::patchConstant()` replaces the return value of the constant `ENVIRONMENT` in `Welcome::index` method.
0 commit comments