[Halo] add functions to mock/unmock a method

Review Request #323 — Created July 9, 2014 and submitted

tardypad
Lunr
tardypad:phpunit-4.1.3-mock_method
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


  • 0
  • 0
  • 2
  • 0
  • 2
Description From Last Updated
dinos
  1. 
      
  2. src/Lunr/Halo/LunrBaseTest.php (Diff revision 1)
     
     
    Perhaps explain a bit more
  3. 
      
tardypad
pprkut
  1. 
      
  2. 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.
  3. 
      
tardypad
pprkut
  1. Ship It!
  2. 
      
tardypad
Review request changed

Status: Closed (submitted)

Change Summary:

Merged into master
Loading...