
Mocking function call with PHPUnit
By: a guest on
Sep 29th, 2012 | syntax:
PHP | size: 0.29 KB | hits: 42 | expires: Never
<?php
namespace Test;
function file_get_contents($file) {
return 'Foo Bar';
}
class MockingAFunctionCall extends \PHPUnit_Framework_TestCase
{
public function testIWillCallAMockFunction()
{
$this->assertEquals(file_get_contents('fool.txt'), 'Foo Bar');
}
}