Halifax took an active part in Parliament's passage of the Test Act of 1673, and thereby forfeited his friendship with James. In 1674 he brought forward a motion for disarming "popish recusants," and supported one by Lord Carlisle for restricting the marriages in the royal family to Protestants; but he opposed the bill introduced by Lord Danby in 1675, that imposed a test oath on officials and members of parliament, speaking "with that quickness, learning and elegance that are inseparable from all his discourses," and ridiculing the multiplication of oaths, since "no man would ever sleep with open doors. . . should all the town be sworn not to rob." He was now on bad terms with Danby, and a witty sally at that minister's expense caused his dismissal from the council in January 1676.