GithubHelp home page GithubHelp logo

malthesers / fake-info-testing Goto Github PK

View Code? Open in Web Editor NEW

This project forked from arturomorarioja/fake_info

0.0 0.0 0.0 66 KB

Implementation of tests for the Fake Data Generator - Sample PHP class that generates fake data of Danish persons (PHP8 / MariaDB)

PHP 100.00%

fake-info-testing's Introduction

Fake Data Generator

Purpose

Sample PHP class that generates fake data of nonexistent Danish persons.

Dependencies

  • The fake persons' first name, last name, and gender are extracted from the file data/person-names.json.
  • The fake persons' postal code and town are extracted from the MariaDB/MySQL database addresses.

Database Installation

  1. The script db/addresses.sql must be run. It will create the MariaDB/MySQL database addresses.
  2. The file info/info.php contains default database values. It may be necessary to update it with the database configuration in use.

Class FakeInfo - Public methods

- getCPR(): string
- getFullNameAndGender(): array
- getFullNameGenderAndBirthDate(): array
- getCprFullNameAndGender(): array
- getCprFullNameGenderAndBirthDate(): array
- getAddress(): string
- getPhoneNumber(): string
- getFakePerson(): array
- getFakePersons(int $amount): array

Sample Output

echo '<pre>';
$fakeInfo = new FakeInfo;
print_r($fakeInfo->getFakePersons());

Output

Array
(
    [CPR] => 1909743965
    [firstName] => Anton D.
    [lastName] => Jespersen
    [gender] => male
    [birthDate] => 1974-09-19
    [address] => Array
        (
            [street] => WTquWUqMiHLBKXcEÆnMpqhdGæzlrødfAAAJuGGXø
            [number] => 456
            [floor] => 61
            [door] => th
            [postal_code] => 3650
            [town_name] => Ølstykke
        )
    [phoneNumber] => 55129415
)

Tools

PHP8 / MariaDB

Author

Arturo Mora-Rioja ([email protected])

fake-info-testing's People

Contributors

malthesers avatar arturomorarioja avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.