In the decades following the Restoration in 1660, a number of statutes and ordinances were enacted in order to exclude Roman Catholics and nonconformists from holding office. These acts successively laid down that the oaths of allegiance (to the Crown) and supremacy (i.e. that the monarch was supreme head of the Church of England), as well as the sacrament of the Lord's Supper, were to be taken by all persons holding offices, civil or military.
The main statute was the Corporations Act 1661 (13 Chas II, c 1) which was primarily designed to destroy the political power of Dissenters in the towns and in Parliament. By this statute, it was enacted that no person could be legally elected to any office relating to the government of any city or corporation unless, within one year of accepting office, they had received the sacrament of the Lord's Supper according to Anglican rites, and on their election should take the oaths of allegiance, supremacy and non-resistance, and abjure (renounce upon oath) the Solemn League and Covenant.
This was followed by the Popish Recusants (or Test) Act 1672 (25 Chas II, c 2) which was directed primarily against Roman Catholics, but was equally operative against Dissenters. This obliged all holders of civil and military office under the Crown in England and Wales, the Channel Islands and Berwick on Tweed, to take the oaths publicly in the courts of Chancery or King's Bench, or locally at quarter sessions (if they resided further than 30 miles from London or Westminster), and to make a declaration against the Roman Catholic doctrine of transubstantiation.
Their names were to be enrolled and publicly displayed. New office holders were also required, within six months of their admission, to produce a sacrament certificate, signed by the minister and churchwarden of the parish with the signatures of two witnesses appended, attesting that they had received holy communion according to the usage of the Church of England.
The requirements relating to oaths of allegiance and supremacy, and to the production of sacrament certificates, were amended under other subsequent Acts (in particular by the Security of the Succession Act 1702 (1 Anne, c 16) which permitted officials to also take the oaths and to deliver sacrament certificates into the courts of Common Pleas or Exchequer) and remained in force until the Sacramental Test Act 1828 (9 Geo VI, c 17) repealed the sacrament as a qualification for office.