DEV: Add cleanup methods for composer extension hooks that tests can use (PR #13034)

GitHub

thanks!