$mock = $this->getMockBuilder(SomeClass::class)
->setMethods(['doSomething'])
->getMock();
$mock->expects($this->exactly(1))
->method('doSomething')
->withConsecutive(
[$this->attribute($this->greaterThan(4), 'name')]
);
$obj = new stdClass();
$obj->name = 5;
$mock->doSomething($obj);