Isn't there? I think that you need to have shown at least 10 years of national insurance contributions to get the pension: https://www.gov.uk/new-state-pension/your-national-insurance...
Granted, 10 years is not "your whole life", but there is a test.
You may get National Insurance credits if you can’t work - for example because of illness or disability, or if you’re a carer or you’re unemployed.
You may get National Insurance credits if you can’t work - for example because of illness or disability, or if you’re a carer or you’re unemployed.