Add tests for transpose of block matrices (#7244)