I have unit test testing a call PDOStatement::execute()with date()as one of the elements of an array.
Sort of:
$stmt->execute(array ('value1', 'value2', date('Ymd'));
The problem is that my statement uses $this->anything()date functions to represent the result. I think it breaks because it is in an array. Is there a good way to handle this?
My statement is as follows:
$mock->expects($this->once())
->method('execute')
->with(array ('value1', 'value2', $this->anything()));
source
share