The phone function within the mock-jutsu library is a specialized tool designed to generate realistic, E.164 compliant telephone numbers for a wide range of development and testing purposes. In the modern software landscape, where global communication is a core requirement, having access to high-quality test data that mimics real-world formats is essential. By using mock-jutsu, developers can instantly produce strings such as "+905325551234," ensuring that their applications can handle international dialing codes and varying number lengths without the risk of using actual sensitive or private user information.
At its core, this function adheres strictly to the E.164 standard, which is the internationally recognized format for public telecommunication numbering. This standard ensures that every phone number generated includes a leading plus sign followed by a country code and a subscriber number, typically reaching a maximum of fifteen digits. The algorithm behind mock-jutsu ensures that the output is syntactically correct, making it ideal for validating regular expressions in front-end form fields or testing backend logic that parses contact information. Whether you are building a global messaging platform or a simple contact directory, this level of precision in your mock data prevents common "garbage in, garbage out" scenarios during the early stages of development.
The versatility of the phone function is one of its greatest benefits for developers and QA engineers. It is accessible through multiple interfaces to suit different workflows, including a straightforward Python API with jutsu.generate('phone'), a robust Command Line Interface (CLI) for shell scripting, and even a JMeter plugin for performance testing. This cross-platform availability means that engineers can inject realistic test data directly into high-concurrency load tests using the ${__mockjutsu(phone,)} syntax, while backend developers can seed local databases using the Python library. This flexibility streamlines the entire development lifecycle, allowing teams to focus on feature logic rather than manually curating spreadsheets of fake contact details.
Common testing scenarios for this function include verifying SMS gateway integrations, testing two-factor authentication (2FA) workflows, and ensuring database constraints correctly handle the plus symbol and varying digit lengths. By integrating mock-jutsu into your CI/CD pipeline, you ensure that every test run uses fresh, randomized, yet structurally sound data. This reduces the likelihood of edge-case failures in production and enhances the overall reliability of your communication modules. Ultimately, the phone function provides a professional, automated solution for generating the critical contact information required for modern software verification.
mockjutsu generate phone --locale TRmockjutsu generate phone --locale DEmockjutsu bulk phone --count 10 --locale TRmockjutsu export phone --count 10 --format json --locale TRmockjutsu export phone --count 10 --format csv --locale TRmockjutsu export phone --count 10 --format sql --locale TR# --mask: regulation-compliant output (PCI DSS / GDPR / KVKK)mockjutsu generate phone --locale TR --maskmockjutsu bulk phone --count 5 --locale TR --maskfrom mockjutsu import jutsujutsu.generate('phone', locale='TR')jutsu.bulk('phone', count=10, locale='TR')jutsu.template(['phone'], count=5, locale='TR')# mask=True: regulation-compliant outputjutsu.generate('phone', locale='TR', mask=True)jutsu.bulk('phone', count=5, locale='TR', mask=True)${__mockjutsu_comm(phone,TR)}# JMeter Function: __mockjutsu_comm# Parameter 1: phone# Parameter 2: locale (TR/UK/US/DE/FR/RU)${__mockjutsu_comm(phone,DE)}# Add 'mask' keyword to get a regulation-compliant masked value${__mockjutsu_comm(phone,TR,mask)}GET /generate/phone?locale=TR# → {"type":"phone","result":"...","status":"ok"}GET /bulk/phone?count=10&locale=TRPOST /template {"types":["phone"],"count":1,"locale":"TR"}# mask=true: regulation-compliant outputGET /generate/phone?locale=TR&mask=trueGET /bulk/phone?count=5&locale=TR&mask=true| Parameter | Values | Description |
|---|---|---|
| --locale | TR|UK|US|DE|FR|RU | Region / locale for locale-aware output |
| --mask | true | false | Return a regulation-compliant masked value (PCI DSS, GDPR, KVKK…) |