I'm wondering how to go about testing this. Say I have a getter method, and I change the value in the process of a method. Here's a simple example:
public function foo($model)
{
var_dump($model->state());
$model->state('saved');
var_dump($model->state());
}
I mock the model like so:
$model = $this->getMock('Model');
$model->expects($this->any))
->method('state')
->will($this->returnValue('new'));
How should I setup the mock so that the second call returns a different value (saved)?