Advertisement
Guest User

Mocking function call with PHPUnit

a guest
Sep 29th, 2012
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.29 KB | None | 0 0
  1. <?php
  2. namespace Test;
  3.  
  4. function file_get_contents($file) {
  5.     return 'Foo Bar';
  6. }
  7.  
  8. class MockingAFunctionCall extends \PHPUnit_Framework_TestCase
  9. {
  10.     public function testIWillCallAMockFunction()
  11.     {
  12.         $this->assertEquals(file_get_contents('fool.txt'), 'Foo Bar');
  13.     }
  14. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement