Prefer officially reserved fictional ranges
Some numbering authorities publish values for drama, documentation or creative works. Examples include the UK's Ofcom drama ranges and specific Australian values published by ACMA. The North American plan reserves a limited set of 555 line numbers for entertainment and advertising use; not every number containing 555 is fictional.
Where no general fictional range exists, use conspicuous placeholders in documentation, isolate fixtures from communications systems and never trigger calls or messages. GetPhoneNum labels generated output as structural test data rather than a live virtual number.
Make fixtures deterministic
Random data makes failing tests hard to reproduce. Seed a fixture factory or keep a versioned dataset for automated tests. Give each case a stable identifier and record the scenario it exercises: national input, canonical E.164, invalid length, unknown country or unsupported service type.
{
"id": "gb-mobile-fictional-001",
"country": "GB",
"input": "07700 900123",
"e164": "+447700900123",
"expected": "valid_structure"
}Separate positive and negative datasets
A positive fixture should test one intended path. Negative fixtures should each fail for a known reason: too short, too long, invalid country code, alphabetic contamination, duplicated plus sign or a trunk prefix left inside an international value. If one fixture violates five rules, the assertion will not tell you which validation behavior regressed.
Protect staging and demo environments
- Disable outbound SMS and voice by default.
- Allowlist explicit internal destinations when delivery testing is required.
- Use provider test credentials or sandbox modes.
- Redact imported production contact data.
- Log attempted sends without exposing full numbers.
These controls matter even when your fixture source is careful, because a formatting mistake can transform a value into a different destination.
Useful official references
Review Ofcom's drama ranges, ACMA's creative-work numbers and the NANPA 555 reference. Use the GetPhoneNum responsible-use policy as a release checklist.
Fixture review before sharing a demo
Before a screenshot, sales demo or public documentation page goes live, verify that example values are labelled as test data and that the surrounding copy does not imply SMS reception or ownership. If a country has an official drama or creative-work range, use that exact range. If it does not, prefer clear placeholders or keep the fixture inside a disabled delivery environment.
For teams, keep fixture files small, versioned and readable in code review. The goal is not to generate thousands of realistic contacts; it is to make a few important product states reproducible without borrowing real people's data.
How this guide connects to the toolkit
This page is written as an implementation reference, not a generic glossary. Use it with the interactive tools when you need to turn an idea into a testable behavior: generate a fixture, format it, validate the structural claim, then record the country and expected result beside your product test. Keeping the explanation and tool output connected helps future reviewers understand why a number was accepted or rejected.
If you copy an example into your own documentation, also copy the safety context. A phone string without its country, source note and limitation can look like a contactable number. The surrounding guidance is part of the value of the fixture.