php - phpunit mock - setting to return values for specific arguments

one text

How to set the mock

$redis->expects($this->any())
            ->method('get')
            ->will($this->returnValue(1));

will return the value 1 only for specific strings passed in the get method, e.g:

$redis->get('test_string1');

Source