how do I get the real return value of a mocked class/method? I found many possibilities to return fixed values, but I want the result of the mocked method i call
namespace Updater\Model;
class TestClass
{
public function testFunction(){
return 12345;
}
}
class DatabaseTest extends PHPUnit_Framework_TestCase
{
public function testMock(){
$mock = $this->getMock('Updater\Model\TestClass', array('testFunction'));
$mock->expects($this->once())->method('testFunction')
// Call the Funciton.... here i would like to get the value 12345
$result = $mock->testFunction();
}
}
I didn't find anything how to get the real return value.... frustrating :)