Fix DocumentCommandHandler unit tests in cmv4 branch

This is for #6718 

Original conversation at #6727

cc @njx