PHPunit:在模拟查询类型方法上调用预期总是不好的做法吗?

I'm unit testing my php code using PhpUnit. Many developers say that is bad practice to put expectation on query method, that is method that only returns something and does not change state of system ( CQS ). Expectations should be used only on command type methods. For Example:

$this->validatorMock->expects($this->once())
               ->method('isValid')
               ->with('foo')
               ->willReturn(true)

Is considered a bad practice because it couple test to tightly to implementation. Correct way:

$this->validatorMock->method('isValid')
     ->willReturn(true);

However what if I'm testing class that depends on results of validation of some sort eg.:

if ($this->validator->isValid($data) {
         // some logic
} else {
     // some other logic
}                                    

Should I put expectation on that method or not? It's a query type method but it is important to test that it was called. I want to know that data was validated.

Of course isValid method itself is tested in seperate testClass ( one that tests validator class )

There are lots of functions that don't modify a state, but just return a value based on input. Validation is one type, conversion is another type.

It makes perfect sense to unit test those functions, because they contain important logic that you don't want to break. I think 'many developers' are wrong here.