Hello, though being new to both the Zend Framework and PHPUnit, I am now trying to write unit tests.
Now I want to test if the latest entries are being shown, so I though I'd insert a Stub that pretends to be the "Entries" class which should extend Zend_Db_Table. However, I don't know how I should set the return value to the results. I currently have this code:
PHP Code:
$entries = $this->getMock('Entries');
$entries->expect($this->any())
->method('fetchAll')
->will($this->returnValue('foo'));
Here, I'd like to replace 'foo' with fake results from Entries::fetchAll() . How do I do that?
Thanks in advance.