Catholics and Protestants
Restoration England was afflicted by religious conflict. A series of Acts of the early 1660s restored the Church of England and enforced harsh penalties against those who refused to be members. Those Nonconformists, along with many of those who did conform, were concerned that the Church was dangerously close to Catholicism in both its government and ceremonies.
Catholicism had long been associated among Protestants with religious 'superstition'. By this period it was also thought to lead inevitably to the absolutist and persecuting rule by which (it was believed) most contemporary Catholic countries, and especially France, were governed.
The Declaration of Indulgence and the Test Act
Charles II's proclamation in 1672, suspending by his royal prerogative the penal statutes against Nonconformists (known as the Declaration of Indulgence), was seen by many Members of Parliament as evidence of both the King's sympathy for Catholicism and his preference for absolutist rule.
Their opposition was so fierce that Charles II was forced to cancel it in 1673 and instead to agree to Parliament's Test Act. This required all those wishing to hold office to swear an oath to the King and the Protestant English Church and to sign a declaration denying the Catholic doctrine of transubstantiation.
Charles II's younger brother and the heir to the throne James, Duke of York, made his Catholic faith publicly known later that year and resigned all his offices under the terms of the Test Act.
The Popish Plot
In late 1678 flimsy allegations that there was a 'Popish Plot' to murder Charles II inspired Parliament to pass another Test Act. This made all Members of Parliament take the required oaths and sign the declaration before they could take their seats.
A special exception was made for the Duke of York who was able to continue sitting in the House of Lords. The Duke may have been able to survive this attack on his rights, but he was to undergo much worse over the following few years. There were calls to exclude him, and all Catholic successors, from the English throne and the governance of the Church of England.