[Halo] add functions to mock/unmock a method
Review Request #323 — Created July 9, 2014 and submitted
Information | |
---|---|
tardypad | |
Lunr | |
tardypad:phpunit-4.1.3-mock_method | |
Reviewers | |
lunr | |
Can be used to mock static methods using runkit since phpunit doesn't allow it anymore Can be used as well to mock a function f1 in a class when testing another function f2 that is calling f1
Change Summary:
add more explanation
Description: |
|
|||||||||
---|---|---|---|---|---|---|---|---|---|---|
Diff: |
Revision 2 (+35) |
-
-
src/Lunr/Halo/LunrBaseTest.php (Diff revision 2) the signature is uncommon. PHP usually refers to a method within a class as an array, with the first value being the classname or instance, and the second being the method name. Also check how this would work with static methods. Additionally, you can't just make every method public. The access modifier needs to stay the same.
Change Summary:
- use PHP callable signature - added parameter for the redefined method visibility
Diff: |
Revision 3 (+52) |
---|