Why did parliament pass the Test Act of 1673?

Why did parliament pass the Test Act of 1673?