You can write a custom action to capture a method parameter by reference (there is a standard SaveArg
action to capture one by value). But what you want can be achieved in a simpler fashion:
using testing::Property;
using testing::Eq;
EXPECT_CALL(myInterface,
access(Property(&MyObject::getState, Eq(ACCESS_IN_PROGRESS))));