prophesize(PersistenceManager::class); $pmProphecy->setServiceLocator(Argument::any())->willReturn(null); $pmProphecy->getPersistenceById($key)->willReturn($persistence); return $pmProphecy->reveal(); } }