]> git.agnieray.net Git - galette.git/commitdiff
Remove faker
authorJohan Cwiklinski <johan@x-tnd.be>
Sat, 7 Nov 2020 03:09:00 +0000 (04:09 +0100)
committerJohan Cwiklinski <johan@x-tnd.be>
Sat, 7 Nov 2020 08:05:18 +0000 (09:05 +0100)
Remove fakedata feature, drop usage in tests.
closes #1515

16 files changed:
galette/composer.json
galette/composer.lock
galette/includes/core_acls.php
galette/includes/routes/management.routes.php
galette/lib/Galette/Controllers/GaletteController.php
galette/lib/Galette/Util/FakeData.php
galette/templates/default/fake_data.tpl [deleted file]
galette/templates/default/page.tpl
patches/0001-Fix-PHP-7.4-array-syntax.patch [deleted file]
tests/Galette/Core/tests/units/Links.php
tests/Galette/Core/tests/units/Login.php
tests/Galette/Entity/tests/units/Adherent.php
tests/Galette/Entity/tests/units/Contribution.php
tests/Galette/IO/tests/units/CsvIn.php
tests/Galette/Middleware/tests/unit/CheckAcls.php
tests/Galette/Repository/tests/units/Reminders.php

index 747309ed937cd326f480023b19cb29db43bd9da2..ee122ef91086f0c6557d2275256c8dc4599c6667 100644 (file)
@@ -37,7 +37,6 @@
         "phpmailer/phpmailer": "^6",
         "tecnickcom/tcpdf": "^6.2",
         "akrabat/rka-slim-session-middleware": "dev-master@dev",
-        "fzaninotto/faker": "dev-master#674d89ac0dd42a03cca42523a0f72bdea90b2725",
         "laminas/laminas-i18n": "^2.9",
         "laminas/laminas-cache": "^2.8",
         "soundasleep/html2text": "^0.5.0",
     },
     "config": {
         "optimize-autoloader": true
-    },
-    "scripts": {
-        "post-install-cmd": [
-            "patch -d vendor/fzaninotto/faker/ -p1 < ../patches/0001-Fix-PHP-7.4-array-syntax.patch"
-        ]
     }
 }
index f30cfe337ee347a365d89ed428d404402db3f5df..c36783f38ed6fc4c8aefd961ca26bb16512522eb 100644 (file)
@@ -4,7 +4,7 @@
         "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
         "This file is @generated automatically"
     ],
-    "content-hash": "8658ccfa33ef5ec58d263f02cdc60255",
+    "content-hash": "641e8ce2188d77e881c7c6962b17e034",
     "packages": [
         {
             "name": "akrabat/rka-slim-session-middleware",
             "abandoned": "psr/container",
             "time": "2017-02-14T19:40:03+00:00"
         },
-        {
-            "name": "fzaninotto/faker",
-            "version": "dev-master",
-            "source": {
-                "type": "git",
-                "url": "https://github.com/fzaninotto/Faker.git",
-                "reference": "674d89ac0dd42a03cca42523a0f72bdea90b2725"
-            },
-            "dist": {
-                "type": "zip",
-                "url": "https://api.github.com/repos/fzaninotto/Faker/zipball/674d89ac0dd42a03cca42523a0f72bdea90b2725",
-                "reference": "674d89ac0dd42a03cca42523a0f72bdea90b2725",
-                "shasum": ""
-            },
-            "require": {
-                "php": "^5.3.3 || ^7.0"
-            },
-            "require-dev": {
-                "ext-intl": "*",
-                "phpunit/phpunit": "^4.8.35 || ^5.7",
-                "squizlabs/php_codesniffer": "^2.9.2"
-            },
-            "type": "library",
-            "extra": {
-                "branch-alias": {
-                    "dev-master": "1.9-dev"
-                }
-            },
-            "autoload": {
-                "psr-4": {
-                    "Faker\\": "src/Faker/"
-                }
-            },
-            "notification-url": "https://packagist.org/downloads/",
-            "license": [
-                "MIT"
-            ],
-            "authors": [
-                {
-                    "name": "François Zaninotto"
-                }
-            ],
-            "description": "Faker is a PHP library that generates fake data for you.",
-            "keywords": [
-                "data",
-                "faker",
-                "fixtures"
-            ],
-            "abandoned": true,
-            "time": "2019-10-17T13:03:13+00:00"
-        },
         {
             "name": "laminas/laminas-cache",
             "version": "2.9.0",
     "minimum-stability": "stable",
     "stability-flags": {
         "akrabat/rka-slim-session-middleware": 20,
-        "fzaninotto/faker": 20,
         "atoum/atoum": 20,
         "galette/smarty-xgettext": 20
     },
         "php": ">=7.2.5"
     },
     "platform-dev": [],
-    "plugin-api-version": "1.1.0"
+    "plugin-api-version": "2.0.0"
 }
index 645e2144c38163038c10882f58d1358dab23c557..89f6f3cb25fc5cbb9007367a1da0c19b50a587c2 100644 (file)
@@ -39,7 +39,6 @@ $core_acls = [
     'impersonate'                       => 'superadmin',
     'unimpersonate'                     => 'member',
     '/(.+)?admin(.+)?/i'                => 'superadmin',
-    '/(.+)?fake(.+)?/i'                 => 'superadmin',
     '/(.+)?telemetry(.+)?/i'            => 'admin',
     'setRegistered'                     => 'admin',
     '/(.+)?preferences(.+)?/i'          => 'admin',
index c05bebb92b0780180321cc9e4f622c0230952e5e..898f9577009e78218ed8f66965e18a88d6fba094 100644 (file)
@@ -375,18 +375,6 @@ $app->post(
     Crud\DynamicFieldsController::class . ':doEdit'
 )->setName('doEditDynamicField')->add($authenticate);
 
-if (GALETTE_MODE != 'DEMO') {
-    $app->get(
-        '/generate-data',
-        GaletteController::class . ':fakeData'
-    )->setName('fakeData')->add($authenticate);
-
-    $app->post(
-        '/generate-data',
-        GaletteController::class . ':doFakeData'
-    )->setName('doFakeData')->add($authenticate);
-}
-
 $app->get(
     '/admin-tools',
     AdminToolsController::class . ':adminTools'
index 3f356d5b93b78404729f99bc997aaf3a849b56e7..5634e777ba1e99675a1c45316ee6e64aa2595bc8 100644 (file)
@@ -639,92 +639,6 @@ class GaletteController extends AbstractController
             ->withHeader('Location', $this->router->pathFor('configureListFields', $args));
     }
 
-    /**
-     * Fake data page
-     *
-     * @param Request  $request  PSR Request
-     * @param Response $response PSR Response
-     *
-     * @return Response
-     */
-    public function fakeData(Request $request, Response $response): Response
-    {
-        $params = [
-            'page_title'            => _T('Generate fake data'),
-            'number_members'        => \Galette\Util\FakeData::DEFAULT_NB_MEMBERS,
-            'number_contrib'        => \Galette\Util\FakeData::DEFAULT_NB_CONTRIB,
-            'number_groups'         => \Galette\Util\FakeData::DEFAULT_NB_GROUPS,
-            'number_transactions'   => \Galette\Util\FakeData::DEFAULT_NB_TRANSACTIONS,
-            'photos'                => \Galette\Util\FakeData::DEFAULT_PHOTOS
-        ];
-
-        // display page
-        $this->view->render(
-            $response,
-            'fake_data.tpl',
-            $params
-        );
-        return $response;
-    }
-
-    /**
-     * Generate fake data
-     *
-     * @param Request  $request  PSR Request
-     * @param Response $response PSR Response
-     *
-     * @return Response
-     */
-    public function doFakeData(Request $request, Response $response): Response
-    {
-        $post = $request->getParsedBody();
-
-        $fakedata = new \Galette\Util\FakeData($this->zdb, $this->i18n);
-
-        $fakedata->setDependencies(
-            $this->preferences,
-            $this->members_fields,
-            $this->history,
-            $this->login
-        );
-
-        $fakedata
-            ->setNbMembers($post['number_members'])
-            ->setNbGroups($post['number_groups'])
-            ->setNbTransactions($post['number_transactions'])
-            ->setMaxContribs($post['number_contrib'])
-            ->setWithPhotos(isset($post['photos']));
-
-        $fakedata->generate();
-
-        $report = $fakedata->getReport();
-
-        foreach ($report['success'] as $success) {
-            $this->flash->addMessage(
-                'success_detected',
-                $success
-            );
-        }
-
-        foreach ($report['errors'] as $error) {
-            $this->flash->addMessage(
-                'error_detected',
-                $error
-            );
-        }
-
-        foreach ($report['warnings'] as $warning) {
-            $this->flash->addMessage(
-                'warning_detected',
-                $warning
-            );
-        }
-
-        return $response
-            ->withStatus(301)
-            ->withHeader('Location', $this->router->pathFor('slash'));
-    }
-
     /**
      * Reminders page
      *
index 5f50a281214fcb070d7c6c3248055d302caf3a11..98c4e7c993c02b7466851b4ddff92dcb6e033c42 100644 (file)
@@ -66,396 +66,12 @@ use Galette\Entity\PaymentType;
  */
 class FakeData
 {
-    public const DEFAULT_NB_MEMBERS       = 20;
-    public const DEFAULT_NB_CONTRIB       = 5;
-    public const DEFAULT_NB_GROUPS        = 5;
-    public const DEFAULT_NB_TRANSACTIONS  = 2;
-    public const DEFAULT_PHOTOS           = false;
-
-    protected $preferences;
-    protected $member_fields;
-    protected $history;
-    protected $login;
-
-    protected $zdb;
-    protected $i18n;
-    protected $faker;
     private $report = [
         'success'   => [],
         'errors'    => [],
         'warnings'  => []
     ];
 
-    protected $groups       = [];
-    protected $mids         = [];
-    protected $transactions = [];
-    protected $titles       = [];
-    protected $status;
-    protected $contrib_types;
-
-    /**
-     * @var integer
-     * Number of members to generate
-     */
-    protected $nbmembers = self::DEFAULT_NB_MEMBERS;
-
-    /**
-     * @var boolean
-     * With members photos
-     */
-    protected $with_photos = self::DEFAULT_PHOTOS;
-
-    /**
-     * @var integer
-     * Number of groups to generate
-     */
-    protected $nbgroups = self::DEFAULT_NB_GROUPS;
-
-    /**
-     * @var integer
-     * Max number of contributions to generate
-     * for each member
-     */
-    protected $maxcontribs = self::DEFAULT_NB_CONTRIB;
-
-    /**
-     * @var integer
-     * Number of transactions to generate
-     */
-    protected $nbtransactions = self::DEFAULT_NB_TRANSACTIONS;
-
-    /**
-     * @var integer
-     * Seed to use for data generation (to get same data accross runs)
-     */
-    protected $seed;
-
-    /**
-     * Default constructor
-     *
-     * @param Db      $zdb      Db instance
-     * @param I18n    $i18n     Current language
-     * @param boolean $generate Process data generation; defaults to false
-     *
-     * @return void
-     */
-    public function __construct(Db $zdb, I18n $i18n, $generate = false)
-    {
-        $this->zdb = $zdb;
-        $this->i18n = $i18n;
-        if ($generate) {
-            $this->generate();
-        }
-    }
-
-    /**
-     * Set seed
-     *
-     * @param integer $seed Seed
-     *
-     * @return FakeData
-     */
-    public function setSeed($seed)
-    {
-        $this->seed = $seed;
-        return $this;
-    }
-
-    /**
-     * Set number of members to generate
-     *
-     * @param integer $nb Number of members
-     *
-     * @return FakeData
-     */
-    public function setNbMembers($nb)
-    {
-        $this->nbmembers = (int)$nb;
-        return $this;
-    }
-
-    /**
-     * Set maximum number of contribution per member to generate
-     *
-     * @param integer $nb Number of contributions
-     *
-     * @return FakeData
-     */
-    public function setMaxContribs($nb)
-    {
-        $this->maxcontribs = (int)$nb;
-        return $this;
-    }
-
-    /**
-     * Set number of groups to generate
-     *
-     * @param integer $nb Number of groups
-     *
-     * @return FakeData
-     */
-    public function setNbGroups($nb)
-    {
-        $this->nbgroups = (int)$nb;
-        return $this;
-    }
-
-    /**
-     * Set number of transactions to generate
-     *
-     * @param integer $nb Number of transactions
-     *
-     * @return FakeData
-     */
-    public function setNbTransactions($nb)
-    {
-        $this->nbtransactions = (int)$nb;
-        return $this;
-    }
-
-    /**
-     * Set with members photos or not
-     *
-     * @param boolean $with With photos
-     *
-     * @return FakeData
-     */
-    public function setWithPhotos($with)
-    {
-        $this->with_photos = $with;
-        return $this;
-    }
-
-    /**
-     * Get (and create if needed) Faker instance
-     *
-     * @return \Faker\Factory
-     */
-    public function getFaker()
-    {
-        if ($this->faker === null) {
-            $this->faker = \Faker\Factory::create($this->i18n->getID());
-        }
-        return $this->faker;
-    }
-
-    /**
-     * Do data generation
-     *
-     * @return void
-     */
-    public function generate()
-    {
-        $this->getFaker();
-        if ($this->seed !== null) {
-            $this->faker->seed($this->seed);
-        }
-
-        $this->generateGroups($this->nbgroups);
-        $this->generateMembers($this->nbmembers);
-        $this->generateTransactions($this->nbtransactions);
-        $this->generateContributions();
-    }
-
-    /**
-     * Generate groups
-     *
-     * @param integer $count Number of groups to generate
-     *
-     * @return void
-     */
-    public function generateGroups($count = null)
-    {
-        $faker = $this->getFaker();
-
-        $done = 0;
-        $parent_group = null;
-
-        if ($count === null) {
-            $count = $this->nbgroups;
-        }
-
-        for ($i = 0; $i < $count; $i++) {
-            $group = new Group();
-            $group->setName($faker->unique()->lastName());
-            if (count($this->groups) > 0 && $faker->boolean($chanceOfGettingTrue = 10)) {
-                if ($parent_group === null) {
-                    $parent_group = $faker->randomElement($this->groups);
-                }
-                $group->setParentGroup($parent_group->getId());
-            }
-
-            if ($group->store()) {
-                $this->groups[] = $group;
-                ++$done;
-            }
-        }
-
-        if ($count != 0 && $done != 0) {
-            if ($done === $count) {
-                $this->addSuccess(
-                    str_replace('%count', $count, _T("%count groups created"))
-                );
-            } else {
-                $this->addWarning(
-                    str_replace(
-                        ['%count', '%done'],
-                        [$count, $done],
-                        _T("%count groups requested, and %done created")
-                    )
-                );
-            }
-        }
-    }
-
-    /**
-     * Generate members
-     *
-     * @param integer $count Number of members to generate
-     *
-     * @return void
-     */
-    public function generateMembers($count = null)
-    {
-        $faker = $this->getFaker();
-        $done = 0;
-        $photos_done = 0;
-
-        if ($count === null) {
-            $count = $this->nbmembers;
-        }
-
-        for ($i = 0; $i < $count; $i++) {
-            $data = $this->fakeMember();
-
-            $member = new Adherent($this->zdb);
-            $member->setDependencies(
-                $this->preferences,
-                $this->member_fields,
-                $this->history
-            );
-            if ($member->check($data, [], [])) {
-                if ($member->store()) {
-                    $this->mids[] = $member->id;
-                    ++$done;
-                    if ($this->with_photos && $faker->boolean($chanceOfGettingTrue = 70)) {
-                        if ($this->addPhoto($member)) {
-                            ++$photos_done;
-                        }
-                    }
-                }
-
-                //add to a group?
-                if (count($this->groups) > 0 && $faker->boolean($chanceOfGettingTrue = 60)) {
-                    $groups = $faker->randomElements($this->groups);
-                    foreach ($groups as $group) {
-                        $manager = $faker->boolean($chanceOfGettingTrue = 10);
-                        if ($manager) {
-                            $managers = $group->getManagers();
-                            $managers[] = $member;
-                            $group->setManagers($managers);
-                        } else {
-                            $members = $group->getMembers();
-                            $members[] = $member;
-                            $group->setMembers($members);
-                        }
-                    }
-                }
-            }
-        }
-
-        if ($count != 0 && $done != 0) {
-            if ($done === $count) {
-                $this->addSuccess(
-                    str_replace('%count', $count, _T("%count members created"))
-                );
-            } else {
-                $this->addWarning(
-                    str_replace(
-                        ['%count', '%done'],
-                        [$count, $done],
-                        _T("%count members requested, and %done created")
-                    )
-                );
-            }
-        }
-        if ($this->with_photos === true) {
-            if ($photos_done > 0) {
-                $this->addSuccess(
-                    str_replace('%count', $count, _T("%count photos created"))
-                );
-            } else {
-                $this->addWarning(
-                    _T("No photo has been created")
-                );
-            }
-        }
-    }
-
-    /**
-     * Get faked member data
-     *
-     * @return array
-     */
-    public function fakeMember()
-    {
-        $faker = $this->getFaker();
-        if ($this->seed !== null) {
-            $this->faker->seed($this->seed);
-        }
-        $creation_date = $faker->dateTimeBetween($startDate = '-3 years', $endDate = 'now');
-        $mdp_adh = $faker->password();
-
-        if ($this->status === null) {
-            $status = new Status($this->zdb);
-            $this->status = array_keys($status->getList());
-        }
-
-        $data = [
-            'nom_adh'           => $faker->lastName(),
-            'prenom_adh'        => $faker->firstName(),
-            'ville_adh'         => $faker->city(),
-            'cp_adh'            => $faker->postcode(),
-            'adresse_adh'       => $faker->streetAddress(),
-            'ville_adh'         => $faker->city(),
-            'email_adh'         => $faker->unique()->email(),
-            'login_adh'         => $faker->unique()->userName(),
-            'mdp_adh'           => $mdp_adh,
-            'mdp_adh2'          => $mdp_adh,
-            'bool_admin_adh'    => $faker->boolean($chanceOfGettingTrue = 5),
-            'bool_exempt_adh'   => $faker->boolean($chanceOfGettingTrue = 5),
-            'bool_display_info' => $faker->boolean($chanceOfGettingTrue = 70),
-            'sexe_adh'          => $faker->randomElement([Adherent::NC, Adherent::MAN, Adherent::WOMAN]),
-            'prof_adh'          => $faker->jobTitle(),
-            'titre_adh'         => $faker->randomElement(array_keys($this->titles)),
-            'ddn_adh'           => $faker->dateTimeBetween(
-                $startDate = '-110 years',
-                $endDate = date('Y-m-d')
-            )->format(_T("Y-m-d")),
-            'lieu_naissance'    => $faker->city(),
-            'pseudo_adh'        => $faker->userName(),
-            'adresse_adh'       => $faker->streetAddress(),
-            'cp_adh'            => $faker->postcode(),
-            'ville_adh'         => $faker->city(),
-            'pays_adh'          => $faker->optional()->country(),
-            'tel_adh'           => $faker->phoneNumber(),
-            'url_adh'           => $faker->optional()->url(),
-            'activite_adh'      => $faker->boolean($chanceOfGettingTrue = 90),
-            'id_statut'         => $faker->optional($weight = 0.3, $default = Status::DEFAULT_STATUS)
-                                    ->randomElement($this->status),
-            'date_crea_adh'     => $creation_date->format(_T("Y-m-d")),
-            'pref_lang'         => $faker->randomElement(array_keys($this->i18n->getArrayList())),
-            'fingerprint'       => 'FAKER' . ($this->seed !== null ? $this->seed : '')
-        ];
-
-        if ($faker->boolean($chanceOfGettingTrue = 20)) {
-            $data['societe_adh'] = $faker->company();
-            $data['is_company'] = true;
-        }
-
-        return $data;
-    }
-
     /**
      * Add photo to a member
      *
@@ -498,181 +114,6 @@ class FakeData
         return false;
     }
 
-    /**
-     * Generate transactions
-     *
-     * @param integer $count Number of transactions to generate
-     * @param array   $mids  Members ids. Defaults to null (will work with previously generated ids)
-     *
-     * @return void
-     */
-    public function generateTransactions($count = null, $mids = null)
-    {
-        $faker = $this->getFaker();
-
-        $done = 0;
-
-        if ($count === null) {
-            $count = $this->nbtransactions;
-        }
-
-        if ($mids === null) {
-            $mids = $this->mids;
-        }
-
-        for ($i = 0; $i < $count; $i++) {
-            $data = [
-                'trans_date'    => $faker->dateTimeBetween($startDate = '-1 years', $endDate = 'now')->format(_T("Y-m-d")),
-                Adherent::PK    => $faker->randomElement($mids),
-                'trans_amount'  => $faker->numberBetween($min = 50, $max = 2000),
-                'trans_desc'    => $faker->realText($maxNbChars = 150)
-            ];
-
-            $transaction = new Transaction($this->zdb, $this->login);
-            if ($transaction->check($data, [], [])) {
-                if ($transaction->store($this->history)) {
-                    $this->transactions[] = $transaction;
-                    ++$done;
-                }
-            }
-        }
-
-        if ($count != 0 && $done != 0) {
-            if ($done === $count) {
-                $this->addSuccess(
-                    str_replace('%count', $count, _T("%count transactions created"))
-                );
-            } else {
-                $this->addWarning(
-                    str_replace(
-                        ['%count', '%done'],
-                        [$count, $done],
-                        _T("%count transactions requested, and %done created")
-                    )
-                );
-            }
-        }
-    }
-
-    /**
-     * Generate members contributions
-     *
-     * @param array $mids Members ids. Defaults to null (will work with previously generated ids)
-     *
-     * @return void
-     */
-    public function generateContributions($mids = null)
-    {
-        $faker = $this->getFaker();
-
-        if ($this->maxcontribs == 0) {
-            return;
-        }
-
-        if ($mids === null) {
-            $mids = $this->mids;
-        }
-
-        $done = 0;
-
-        foreach ($mids as $mid) {
-            $nbcontribs = $faker->numberBetween(0, $this->maxcontribs);
-            for ($i = 0; $i < $nbcontribs; $i++) {
-                $data = $this->fakeContrib($mid);
-                $contrib = new Contribution($this->zdb, $this->login);
-                if ($contrib->check($data, [], []) === true) {
-                    if ($contrib->store()) {
-                        $pk = Contribution::PK;
-                        $this->cids[] = $contrib->$pk;
-                        ++$done;
-                    }
-
-                    if (count($this->transactions) > 0) {
-                        if ($faker->boolean($chanceOfGettingTrue = 90)) {
-                            $transaction = $faker->randomElement($this->transactions);
-                            $contrib::setTransactionPart(
-                                $this->zdb,
-                                $transaction->id,
-                                $contrib->id
-                            );
-                        }
-                    }
-                }
-            }
-        }
-
-        if ($done > 0) {
-            $this->addSuccess(
-                str_replace('%count', $done, _T("%count contributions created"))
-            );
-        } else {
-            $this->addError(
-                _T("No contribution created!")
-            );
-        }
-    }
-
-    /**
-     * Get faked contribution data
-     *
-     * @param integer $mid Member id.
-     *
-     * @return array
-     */
-    public function fakeContrib($mid)
-    {
-        $faker = $this->getFaker();
-        if ($this->seed !== null) {
-            $this->faker->seed($this->seed);
-        }
-
-        if ($this->contrib_types === null) {
-            $ct = new ContributionsTypes($this->zdb);
-            $this->contrib_types = $ct->getCompleteList();
-        }
-        $types = $this->contrib_types;
-
-        $begin_date = $faker->dateTimeBetween($startDate = '-3 years', $endDate = 'now');
-        $end_date = clone $begin_date;
-        $end_date->modify('+1 year');
-        if (!$begin_date) {
-            $begin_date = new \DateTime();
-        }
-
-        $data = [
-            Adherent::PK            => $mid,
-            ContributionsTypes::PK  => $faker->randomElement(array_keys($types)),
-            'montant_cotis'         => $faker->numberBetween($min = 5, $max = 200),
-            'type_paiement_cotis'   => $faker->randomElement(
-                [
-                    PaymentType::OTHER,
-                    PaymentType::CASH,
-                    PaymentType::CREDITCARD,
-                    PaymentType::CHECK,
-                    PaymentType::TRANSFER,
-                    PaymentType::PAYPAL
-                ]
-            ),
-            'info_cotis'            => ($this->seed !== null ?
-                                        'FAKER' . $this->seed : $faker->optional($weight = 0.1)->realText($maxNbChars = 500)),
-            'date_enreg'            => $faker->dateTimeBetween($startDate = '-1 years', $endDate = 'now')->format(_T("Y-m-d")),
-            'date_debut_cotis'      => $begin_date->format(_T("Y-m-d")),
-            'date_fin_cotis'        => $end_date->format(_T("Y-m-d"))
-        ];
-
-        if (count($this->transactions) > 0) {
-            if ($faker->boolean($chanceOfGettingTrue = 90)) {
-                $transaction = $faker->randomElement($this->transactions);
-                $missing = $transaction->getMissingAmount();
-                if ($data['montant_cotis'] > $missing) {
-                    $data['montant_cotis'] = $missing;
-                }
-            }
-        }
-
-        return $data;
-    }
-
     /**
      * Add success message
      *
@@ -718,38 +159,4 @@ class FakeData
     {
         return $this->report;
     }
-
-    /**
-     * Set dependencies
-     *
-     * @param Preferences $preferences Preferences instance
-     * @param array       $fields      Members fields configuration
-     * @param History     $history     History instance
-     * @param Login       $login       Login instance
-     *
-     * @return FakeData
-     */
-    public function setDependencies(
-        Preferences $preferences,
-        array $fields,
-        History $history,
-        Login $login
-    ) {
-        $this->preferences = $preferences;
-        $this->member_fields = $fields;
-        $this->history = $history;
-        $this->login = $login;
-
-        return $this;
-    }
-
-    /**
-     * Get generated members ids
-     *
-     * @return array
-     */
-    public function getMembersIds()
-    {
-        return $this->mids;
-    }
 }
diff --git a/galette/templates/default/fake_data.tpl b/galette/templates/default/fake_data.tpl
deleted file mode 100644 (file)
index b888265..0000000
+++ /dev/null
@@ -1,66 +0,0 @@
-{extends file="page.tpl"}
-{block name="content"}
-    <form action="{path_for name="doFakeData"}" method="post" enctype="multipart/form-data">
-        <div class="bigtable">
-        <fieldset class="galette_form" id="core">
-            <legend>{_T string="Core data"}</legend>
-            <div>
-                <p>
-                    <label for="number_members">{_T string="Number of members:"}</label>
-                    <input type="number" name="number_members" id="number_members" value="{$number_members}" min="0" max="100"/>
-                </p>
-                <p>
-                    <label for="photos" class="tooltip" title="{_T string="Add photos for members."} {_T string="Each photos mays take a long time to be retrieved. Use this only with a few members!"}">{_T string="Add members photos"}</label>
-                    <span class="tip">{_T string="Add photos for members."}<br/><strong>{_T string="Each photos mays take a long time to be retrieved. Use this only with a few members!"}</strong></span>
-                    <input type="checkbox" name="photos" id="photos"{if $photos} checked="checked"{/if}/>
-                </p>
-                <p>
-                    <label for="number_groups">{_T string="Number of groups:"}</label>
-                    <input type="number" name="number_groups" id="number_groups" value="{$number_groups}" min="0" max="10"/>
-                </p>
-                <p>
-                    <label for="number_contrib" class="tooltip" title="{_T string="Maximum number of contributions to generate for reach member"}">{_T string="Number of contributions:"}</label>
-                    <span class="tip">{_T string="Maximum number of contributions to generate for reach member"}</span>
-                    <input type="number" name="number_contrib" id="number_contrib" value="{$number_contrib}" min="0" max="10"/>
-                </p>
-                <p>
-                    <label for="number_transactions">{_T string="Number of transactions:"}</label>
-                    <input type="number" name="number_transactions" id="number_transactions" value="{$number_transactions}" min="0" max="5"/>
-                </p>
-            </div>
-        </fieldset>
-        <!--fieldset class="galette_form" id="core">
-            <legend>{_T string="Dynamic fields"}</legend>
-            <div>
-                <p class="center">{_T string="Generate some predefined dynamic fields"}</p>
-                <p>
-                    <label for="dynamic_fields_adh">{_T string="Members"}</label>
-                    <input type="checkbox" name="dynamic_fields_adh" id="dynamic_fields_adh" value="1" checked="checked"/>
-                </p>
-                <p>
-                    <label for="dynamic_fields_contrib">{_T string="Contributions"}</label>
-                    <input type="checkbox" name="dynamic_fields_contrib" id="dynamic_fields_contrib" value="1" checked="checked"/>
-                </p>
-                <p>
-                    <label for="dynamic_fields_trans">{_T string="Transactions"}</label>
-                    <input type="checkbox" name="dynamic_fields_trans" id="dynamic_fields_trans" value="1" checked="checked"/>
-                </p>
-            </div>
-        </fieldset-->
-        </div>
-        <div class="button-container">
-            <button ype="submit" class="action">
-                <i class="fas fa-play" aria-hidden="true"></i>
-                {_T string="Generate"}
-            </button>
-        </div>
-    </form>
-{/block}
-
-{block name="javascripts"}
-    <script type="text/javascript">
-        $(function() {
-            _collapsibleFieldsets();
-        });
-    </script>
-{/block}
index f171fcd8762be7b4b4265c84442faea736d0de65..8fdbbd4d09d475270b99d314b5b61aca2ede8250 100644 (file)
@@ -91,9 +91,6 @@ We have to use a template file, so Smarty will do its work (like replacing varia
             <li{if $cur_route eq "paymentTypes"} class="selected"{/if}><a href="{path_for name="paymentTypes"}" title="{_T string="Manage payment types"}">{_T string="Payment types"}</a></li>
             <li><a href="{path_for name="emptyAdhesionForm"}" title="{_T string="Download empty adhesion form"}">{_T string="Empty adhesion form"}</a></li>
     {if $login->isSuperAdmin()}
-        {if $GALETTE_MODE neq 'DEMO'}
-            <li{if $cur_route eq "fakeData"} class="selected"{/if}><a href="{path_for name="fakeData"}">{_T string="Generate fake data"}</a></li>
-        {/if}
             <li{if $cur_route eq "adminTools"} class="selected"{/if}><a href="{path_for name="adminTools"}" title="{_T string="Various administrative tools"}">{_T string="Admin tools"}</a></li>
     {/if}
         </ul>
diff --git a/patches/0001-Fix-PHP-7.4-array-syntax.patch b/patches/0001-Fix-PHP-7.4-array-syntax.patch
deleted file mode 100644 (file)
index 38904ad..0000000
+++ /dev/null
@@ -1,69 +0,0 @@
-From a26b3e795b9fdc353a6e984a14dbbb1a35f93be5 Mon Sep 17 00:00:00 2001
-From: Johan Cwiklinski <jcwiklinski@teclib.com>
-Date: Sat, 19 Oct 2019 23:14:40 +0200
-Subject: [PATCH] Fix PHP 7.4 array syntax
-
----
- src/Faker/Calculator/Luhn.php            | 4 ++--
- test/Faker/Provider/fi_FI/PersonTest.php | 4 ++--
- test/Faker/Provider/sv_SE/PersonTest.php | 4 ++--
- 3 files changed, 6 insertions(+), 6 deletions(-)
-
-diff --git a/src/Faker/Calculator/Luhn.php b/src/Faker/Calculator/Luhn.php
-index c37c6c19..1cb71a16 100644
---- a/src/Faker/Calculator/Luhn.php
-+++ b/src/Faker/Calculator/Luhn.php
-@@ -24,10 +24,10 @@ class Luhn
-         $length = strlen($number);
-         $sum = 0;
-         for ($i = $length - 1; $i >= 0; $i -= 2) {
--            $sum += $number{$i};
-+            $sum += $number[$i];
-         }
-         for ($i = $length - 2; $i >= 0; $i -= 2) {
--            $sum += array_sum(str_split($number{$i} * 2));
-+            $sum += array_sum(str_split($number[$i] * 2));
-         }
-         return $sum % 10;
-diff --git a/test/Faker/Provider/fi_FI/PersonTest.php b/test/Faker/Provider/fi_FI/PersonTest.php
-index b979666e..3093178e 100644
---- a/test/Faker/Provider/fi_FI/PersonTest.php
-+++ b/test/Faker/Provider/fi_FI/PersonTest.php
-@@ -71,12 +71,12 @@ class PersonTest extends TestCase
-     public function testPersonalIdentityNumberGeneratesOddValuesForMales()
-     {
-         $pin = $this->faker->personalIdentityNumber(null, 'male');
--        $this->assertEquals(1, $pin{9} % 2);
-+        $this->assertEquals(1, $pin[9] % 2);
-     }
-     public function testPersonalIdentityNumberGeneratesEvenValuesForFemales()
-     {
-         $pin = $this->faker->personalIdentityNumber(null, 'female');
--        $this->assertEquals(0, $pin{9} % 2);
-+        $this->assertEquals(0, $pin[9] % 2);
-     }
- }
-diff --git a/test/Faker/Provider/sv_SE/PersonTest.php b/test/Faker/Provider/sv_SE/PersonTest.php
-index 584998da..14e32467 100644
---- a/test/Faker/Provider/sv_SE/PersonTest.php
-+++ b/test/Faker/Provider/sv_SE/PersonTest.php
-@@ -50,12 +50,12 @@ class PersonTest extends TestCase
-     public function testPersonalIdentityNumberGeneratesOddValuesForMales()
-     {
-         $pin = $this->faker->personalIdentityNumber(null, 'male');
--        $this->assertEquals(1, $pin{9} % 2);
-+        $this->assertEquals(1, $pin[9] % 2);
-     }
-     public function testPersonalIdentityNumberGeneratesEvenValuesForFemales()
-     {
-         $pin = $this->faker->personalIdentityNumber(null, 'female');
--        $this->assertEquals(0, $pin{9} % 2);
-+        $this->assertEquals(0, $pin[9] % 2);
-     }
- }
--- 
-2.21.0
-
index f5dddb52e1b68a137529df4bfb156eb707e13dd0..279f441729f94c3382eb89b0f5973cf26d3601f2 100644 (file)
@@ -158,17 +158,36 @@ class Links extends atoum
      */
     private function createAdherent()
     {
-        $fakedata = new \Galette\Util\FakeData($this->zdb, $this->i18n);
-        $fakedata
-            ->setSeed($this->seed)
-            ->setDependencies(
-                $this->preferences,
-                $this->members_fields,
-                $this->history,
-                $this->login
-            );
-
-        $data = $fakedata->fakeMember();
+        $data = [
+            'nom_adh' => 'Hoarau',
+            'prenom_adh' => 'Lucas',
+            'ville_adh' => 'Reynaudnec',
+            'cp_adh' => '63077',
+            'adresse_adh' => '2, boulevard Legros',
+            'email_adh' => 'phoarau@tele2.fr',
+            'login_adh' => 'nathalie51',
+            'mdp_adh' => 'T.u!IbKOi|06',
+            'mdp_adh2' => 'T.u!IbKOi|06',
+            'bool_admin_adh' => false,
+            'bool_exempt_adh' => false,
+            'bool_display_info' => false,
+            'sexe_adh' => 1,
+            'prof_adh' => 'Extraction',
+            'titre_adh' => null,
+            'ddn_adh' => '1992-09-13',
+            'lieu_naissance' => 'Fischer',
+            'pseudo_adh' => 'vallet.camille',
+            'pays_adh' => null,
+            'tel_adh' => '05 59 53 59 43',
+            'url_adh' => 'http://bodin.net/omnis-ratione-sint-dolorem-architecto',
+            'activite_adh' => true,
+            'id_statut' => 9,
+            'date_crea_adh' => '2019-05-20',
+            'pref_lang' => 'ca',
+            'fingerprint' => 'FAKER' . $this->seed,
+            'societe_adh' => 'Philippe',
+            'is_company' => true,
+        ];
         $this->createMember($data);
         $this->checkMemberExpected();
     }
@@ -475,17 +494,24 @@ class Links extends atoum
      */
     private function createContribution()
     {
-        $fakedata = new \Galette\Util\FakeData($this->zdb, $this->i18n);
-        $fakedata
-            ->setSeed($this->seed)
-            ->setDependencies(
-                $this->preferences,
-                $this->members_fields,
-                $this->history,
-                $this->login
-            );
-
-        $data = $fakedata->fakeContrib($this->adh->id);
+        $bdate = new \DateTime(); // 2020-11-07
+        $bdate->sub(new \DateInterval('P1Y')); // 2019-11-07
+        $bdate->sub(new \DateInterval('P6M')); // 2019-05-07
+        $bdate->add(new \DateInterval('P13D')); // 2019-05-20
+
+        $edate = clone $bdate;
+        $edate->add(new \DateInterval('P1Y'));
+
+        $data = [
+            'id_adh' => $this->adh->id,
+            'id_type_cotis' => 3,
+            'montant_cotis' => 111,
+            'type_paiement_cotis' => 6,
+            'info_cotis' => 'FAKER' . $this->seed,
+            'date_enreg' => $bdate->format('Y-m-d'),
+            'date_debut_cotis' => $bdate->format('Y-m-d'),
+            'date_fin_cotis' => $edate->format('Y-m-d'),
+        ];
         $this->createContrib($data);
         $this->checkContribExpected();
     }
index 3f6328ed95744a3ac83434437b8b8c81b1fb53cc..bc15430f28df2d76b96df9e68aa730e85e41d4c6 100644 (file)
@@ -311,17 +311,34 @@ class Login extends atoum
                 $this->boolean($res)->isTrue();
             }
 
-            $fakedata = new \Galette\Util\FakeData($this->zdb, $this->i18n);
-            $fakedata
-                ->setSeed($this->seed)
-                ->setDependencies(
-                    $this->preferences,
-                    $this->members_fields,
-                    $this->history,
-                    $this->login
-                );
-
-            $data = $fakedata->fakeMember();
+            $data = [
+                'nom_adh' => 'Barre',
+                'prenom_adh' => 'Olivier',
+                'ville_adh' => 'Le GoffVille',
+                'cp_adh' => '05 029',
+                'adresse_adh' => '9, impasse Frédérique Boulanger',
+                'email_adh' => 'bernadette37@hernandez.fr',
+                'login_adh' => 'dumas.roger',
+                'mdp_adh' => 'sd8)AvtE|*',
+                'mdp_adh2' => 'sd8)AvtE|*',
+                'bool_admin_adh' => false,
+                'bool_exempt_adh' => false,
+                'bool_display_info' => true,
+                'sexe_adh' => 1,
+                'prof_adh' => 'Pédologue',
+                'titre_adh' => null,
+                'ddn_adh' => '23/10/1948',
+                'lieu_naissance' => 'Lagarde',
+                'pseudo_adh' => 'elisabeth50',
+                'pays_adh' => 'Géorgie',
+                'tel_adh' => '05 05 20 88 04',
+                'url_adh' => 'http://www.gay.com/tempora-nemo-quidem-laudantium-dolores',
+                'activite_adh' => true,
+                'id_statut' => 6,
+                'date_crea_adh' => '02/09/2019',
+                'pref_lang' => 'nb_NO',
+                'fingerprint' => 'FAKER' . $this->seed,
+            ];
 
             $this->adh = new \Galette\Entity\Adherent($this->zdb);
             $this->adh->setDependencies(
index f948f15a5890dd6dd4cc3d8af087d2ded31ff0fa..51b68960d735e6996eebdb3b62090e8b94d7516e 100644 (file)
@@ -170,17 +170,34 @@ class Adherent extends atoum
      */
     private function dataAdherent(): array
     {
-        $fakedata = new \Galette\Util\FakeData($this->zdb, $this->i18n);
-        $fakedata
-            ->setSeed($this->seed)
-            ->setDependencies(
-                $this->preferences,
-                $this->members_fields,
-                $this->history,
-                $this->login
-            );
-
-        $data = $fakedata->fakeMember();
+        $data = [
+            'nom_adh' => 'Durand',
+            'prenom_adh' => 'René',
+            'ville_adh' => 'Martel',
+            'cp_adh' => '39 069',
+            'adresse_adh' => '66, boulevard De Oliveira',
+            'email_adh' => 'meunier.josephine@ledoux.com',
+            'login_adh' => 'arthur.hamon',
+            'mdp_adh' => 'J^B-()f',
+            'mdp_adh2' => 'J^B-()f',
+            'bool_admin_adh' => false,
+            'bool_exempt_adh' => false,
+            'bool_display_info' => true,
+            'sexe_adh' => 0,
+            'prof_adh' => 'Chef de fabrication',
+            'titre_adh' => null,
+            'ddn_adh' => '1937-12-26',
+            'lieu_naissance' => 'Gonzalez-sur-Meunier',
+            'pseudo_adh' => 'ubertrand',
+            'pays_adh' => 'Antarctique',
+            'tel_adh' => '0439153432',
+            'url_adh' => 'http://bouchet.com/',
+            'activite_adh' => true,
+            'id_statut' => 9,
+            'date_crea_adh' => '2020-06-10',
+            'pref_lang' => 'en_US',
+            'fingerprint' => 'FAKER' . $this->seed,
+        ];
         return $data;
     }
 
@@ -586,14 +603,6 @@ class Adherent extends atoum
         }
 
         $fakedata = new \Galette\Util\FakeData($this->zdb, $this->i18n);
-        $fakedata
-            ->setSeed($this->seed)
-            ->setDependencies(
-                $this->preferences,
-                $this->members_fields,
-                $this->history,
-                $this->login
-            );
         $this->boolean($fakedata->addPhoto($this->adh))->isTrue();
 
         $this->boolean($this->adh->hasPicture())->isTrue();
index cc4dfcff19068a431575b98cf98fb21bf0a8ca97..71d2c2967914d600abd856f5a903a4456f16bae6 100644 (file)
@@ -147,17 +147,34 @@ class Contribution extends atoum
      */
     private function createAdherent()
     {
-        $fakedata = new \Galette\Util\FakeData($this->zdb, $this->i18n);
-        $fakedata
-            ->setSeed($this->seed)
-            ->setDependencies(
-                $this->preferences,
-                $this->members_fields,
-                $this->history,
-                $this->login
-            );
-
-        $data = $fakedata->fakeMember();
+        $data = [
+            'nom_adh' => 'Durand',
+            'prenom_adh' => 'René',
+            'ville_adh' => 'Martel',
+            'cp_adh' => '39 069',
+            'adresse_adh' => '66, boulevard De Oliveira',
+            'email_adh' => 'meunier.josephine@ledoux.com',
+            'login_adh' => 'arthur.hamon',
+            'mdp_adh' => 'J^B-()f',
+            'mdp_adh2' => 'J^B-()f',
+            'bool_admin_adh' => false,
+            'bool_exempt_adh' => false,
+            'bool_display_info' => true,
+            'sexe_adh' => 0,
+            'prof_adh' => 'Chef de fabrication',
+            'titre_adh' => null,
+            'ddn_adh' => '1937-12-26',
+            'lieu_naissance' => 'Gonzalez-sur-Meunier',
+            'pseudo_adh' => 'ubertrand',
+            'pays_adh' => 'Antarctique',
+            'tel_adh' => '0439153432',
+            'url_adh' => 'http://bouchet.com/',
+            'activite_adh' => true,
+            'id_statut' => 9,
+            'date_crea_adh' => '2020-06-10',
+            'pref_lang' => 'en_US',
+            'fingerprint' => 'FAKER' . $this->seed,
+        ];
         $this->createMember($data);
         $this->checkMemberExpected();
     }
@@ -169,17 +186,23 @@ class Contribution extends atoum
      */
     private function createContribution()
     {
-        $fakedata = new \Galette\Util\FakeData($this->zdb, $this->i18n);
-        $fakedata
-            ->setSeed($this->seed)
-            ->setDependencies(
-                $this->preferences,
-                $this->members_fields,
-                $this->history,
-                $this->login
-            );
-
-        $data = $fakedata->fakeContrib($this->adh->id);
+        $bdate = new \DateTime(); // 2020-11-07
+        $bdate->sub(new \DateInterval('P5M')); // 2020-06-07
+        $bdate->add(new \DateInterval('P3D')); // 2020-06-10
+
+        $edate = clone $bdate;
+        $edate->add(new \DateInterval('P1Y'));
+
+        $data = [
+            'id_adh' => $this->adh->id,
+            'id_type_cotis' => 1,
+            'montant_cotis' => 92,
+            'type_paiement_cotis' => 3,
+            'info_cotis' => 'FAKER' . $this->seed,
+            'date_enreg' => $bdate->format('Y-m-d'),
+            'date_debut_cotis' => $bdate->format('Y-m-d'),
+            'date_fin_cotis' => $edate->format('Y-m-d'),
+        ];
         $this->createContrib($data);
         $this->checkContribExpected();
     }
index 293fa778c3f5b4c893056746de616af2930cc752..730db70f00548ac9d712b28dbb99c145a4a9cdad 100644 (file)
@@ -241,7 +241,6 @@ class CsvIn extends atoum
         $this->string($csvfile_model)
              ->isIdenticalTo("\"" . implode("\";\"", $fields) . "\"\r\n");
 
-        $fakedata = new \Galette\Util\FakeData($this->zdb, $this->i18n);
         $contents = $csvfile_model;
         foreach ($members_list as $member) {
             $amember = [];
@@ -321,21 +320,12 @@ class CsvIn extends atoum
      */
     public function testImport()
     {
-        $fakedata = new \Galette\Util\FakeData($this->zdb, $this->i18n);
-
         $fields = ['nom_adh', 'ville_adh', 'bool_exempt_adh', 'fingerprint'];
         $file_name = 'test-import-atoum.csv';
         $flash_messages = [
             'success_detected' => ["File '$file_name' has been successfully imported :)"]
         ];
-        $members_list = [];
-        for ($i = 0; $i < 10; ++$i) {
-            $data = $fakedata->fakeMember();
-            $data['nom_adh'] = str_replace('"', '""', $data['nom_adh']);
-            $data['ville_adh'] = str_replace('"', '""', $data['ville_adh']);
-            $data['fingerprint'] = 'FAKER_' . $i;
-            $members_list[$data['fingerprint']] = $data;
-        }
+        $members_list = $this->getMemberData1();
         $count_before = 0;
         $count_after = 10;
 
@@ -350,15 +340,7 @@ class CsvIn extends atoum
             ]
         ];
 
-        $members_list = [];
-        for ($i = 0; $i < 10; ++$i) {
-            $data = $fakedata->fakeMember();
-            //two lines without name.
-            $data['nom_adh'] = (($i == 2 || $i == 5) ? '' : str_replace('"', '""', $data['nom_adh']));
-            $data['ville_adh'] = str_replace('"', '""', $data['ville_adh']);
-            $data['fingerprint'] = 'FAKER_' . $i;
-            $members_list[$data['fingerprint']] = $data;
-        }
+        $members_list = $this->getMemberData2NoName();
         $count_before = 10;
         $count_after = 10;
 
@@ -451,21 +433,14 @@ class CsvIn extends atoum
         $result = $this->zdb->execute($select)->current();
         $this->integer((int)$result->num)->isIdenticalTo(1);
 
-        $fakedata = new \Galette\Util\FakeData($this->zdb, $this->i18n);
-
         $fields = ['nom_adh', 'ville_adh', 'dynfield_' . $df->getId(), 'fingerprint'];
         $file_name = 'test-import-atoum-dyn.csv';
         $flash_messages = [
             'success_detected' => ["File '$file_name' has been successfully imported :)"]
         ];
-        $members_list = [];
-        for ($i = 0; $i < 10; ++$i) {
-            $data = $fakedata->fakeMember();
-            $data['nom_adh'] = str_replace('"', '""', $data['nom_adh']);
-            $data['ville_adh'] = str_replace('"', '""', $data['ville_adh']);
-            $data['fingerprint'] = 'FAKER_' . $i;
+        $members_list = $this->getMemberData1();
+        foreach ($members_list as $fingerprint => &$data) {
             $data['dynfield_' . $df->getId()] = 'Dynamic field value for ' . $data['fingerprint'];
-            $members_list[$data['fingerprint']] = $data;
         }
         $count_before = 0;
         $count_after = 10;
@@ -481,16 +456,11 @@ class CsvIn extends atoum
                 'Field nom_adh is required, but missing in row 3'
             ]
         ];
-        $members_list = [];
-        for ($i = 0; $i < 10; ++$i) {
-            $data = $fakedata->fakeMember();
-            //two lines without name.
-            $data['nom_adh'] = (($i == 2 || $i == 5) ? '' : str_replace('"', '""', $data['nom_adh']));
-            $data['ville_adh'] = str_replace('"', '""', $data['ville_adh']);
-            $data['fingerprint'] = 'FAKER_' . $i;
+        $members_list = $this->getMemberData2NoName();
+        foreach ($members_list as $fingerprint => &$data) {
             $data['dynfield_' . $df->getId()] = 'Dynamic field value for ' . $data['fingerprint'];
-            $members_list[$data['fingerprint']] = $data;
         }
+
         $count_before = 10;
         $count_after = 10;
 
@@ -505,17 +475,15 @@ class CsvIn extends atoum
                 'Missing required field Dynamic text field'
             ]
         ];
-        $members_list = [];
-        for ($i = 0; $i < 10; ++$i) {
-            $data = $fakedata->fakeMember();
-            $data['nom_adh'] = str_replace('"', '""', $data['nom_adh']);
-            $data['ville_adh'] = str_replace('"', '""', $data['ville_adh']);
-            $data['fingerprint'] = 'FAKER_' . $i;
+        $members_list = $this->getMemberData2();
+        $i = 0;
+        foreach ($members_list as $fingerprint => &$data) {
             //two lines without required dynamic field.
             $data['dynfield_' . $df->getId()] = (($i == 2 || $i == 5) ? '' :
                 'Dynamic field value for ' . $data['fingerprint']);
-            $members_list[$data['fingerprint']] = $data;
+            ++$i;
         }
+
         $count_before = 10;
         $count_after = 10;
 
@@ -571,16 +539,12 @@ class CsvIn extends atoum
         $flash_messages = [
             'success_detected' => ["File '$file_name' has been successfully imported :)"]
         ];
-        $members_list = [];
-        for ($i = 0; $i < 10; ++$i) {
-            $data = $fakedata->fakeMember();
-            $data['nom_adh'] = str_replace('"', '""', $data['nom_adh']);
-            $data['ville_adh'] = str_replace('"', '""', $data['ville_adh']);
-            $data['fingerprint'] = 'FAKER_' . $i;
-            $faker = $fakedata->getFaker();
-            $data['dynfield_' . $cdf->getId()] = $faker->numberBetween(0, 2);
-            $members_list[$data['fingerprint']] = $data;
+        $members_list = $this->getMemberData1();
+        foreach ($members_list as $fingerprint => &$data) {
+            //two lines without required dynamic field.
+            $data['dynfield_' . $cdf->getId()] = rand(0, 2);
         }
+
         $count_before = 0;
         $count_after = 10;
 
@@ -639,15 +603,12 @@ class CsvIn extends atoum
         $flash_messages = [
             'success_detected' => ["File '$file_name' has been successfully imported :)"]
         ];
-        $members_list = [];
-        for ($i = 0; $i < 10; ++$i) {
-            $data = $fakedata->fakeMember();
-            $data['nom_adh'] = str_replace('"', '""', $data['nom_adh']);
-            $data['ville_adh'] = str_replace('"', '""', $data['ville_adh']);
-            $data['fingerprint'] = 'FAKER_' . $i;
+        $members_list = $this->getMemberData1();
+        foreach ($members_list as $fingerprint => &$data) {
+            //two lines without required dynamic field.
             $data['dynfield_' . $cdf->getId()] = $data['date_crea_adh'];
-            $members_list[$data['fingerprint']] = $data;
         }
+
         $count_before = 0;
         $count_after = 10;
 
@@ -662,18 +623,619 @@ class CsvIn extends atoum
                 '- Wrong date format (Y-m-d) for Dynamic date field!'
             ]
         ];
-        $members_list = [];
-        for ($i = 0; $i < 10; ++$i) {
-            $data = $fakedata->fakeMember();
-            $data['nom_adh'] = str_replace('"', '""', $data['nom_adh']);
-            $data['ville_adh'] = str_replace('"', '""', $data['ville_adh']);
-            $data['fingerprint'] = 'FAKER_' . $i;
+        $members_list = $this->getMemberData2();
+        $i = 0;
+        foreach ($members_list as $fingerprint => &$data) {
+            //two lines without required dynamic field.
             $data['dynfield_' . $cdf->getId()] = (($i == 2 || $i == 5) ? '20200513' : $data['date_crea_adh']);
-            $members_list[$data['fingerprint']] = $data;
+            ++$i;
         }
+
         $count_before = 10;
         $count_after = 10;
 
         $this->doImportFileTest($fields, $file_name, $flash_messages, $members_list, $count_before, $count_after);
     }
+
+    /**
+     * Get first set of member data
+     *
+     * @return array
+     */
+    private function getMemberData1()
+    {
+        return array(
+            'FAKER_0' => array (
+                'nom_adh' => 'Boucher',
+                'prenom_adh' => 'Roland',
+                'ville_adh' => 'Dumas',
+                'cp_adh' => '61276',
+                'adresse_adh' => '5, chemin de Meunier',
+                'email_adh' => 'remy44@lopez.net',
+                'login_adh' => 'jean36',
+                'mdp_adh' => 'HM~OCSl[]UkZp%Y',
+                'mdp_adh2' => 'HM~OCSl[]UkZp%Y',
+                'bool_admin_adh' => false,
+                'bool_exempt_adh' => true,
+                'bool_display_info' => false,
+                'sexe_adh' => 1,
+                'prof_adh' => 'Technicien géomètre',
+                'titre_adh' => null,
+                'ddn_adh' => '1914-03-22',
+                'lieu_naissance' => 'Laurent-sur-Guyot',
+                'pseudo_adh' => 'tgonzalez',
+                'pays_adh' => null,
+                'tel_adh' => '+33 8 93 53 99 52',
+                'url_adh' => null,
+                'activite_adh' => true,
+                'id_statut' => 9,
+                'date_crea_adh' => '2020-03-09',
+                'pref_lang' => 'br',
+                'fingerprint' => 'FAKER_0',
+            ),
+            'FAKER_1' =>  array (
+                'nom_adh' => 'Lefebvre',
+                'prenom_adh' => 'François',
+                'ville_adh' => 'Laine',
+                'cp_adh' => '53977',
+                'adresse_adh' => '311, rue de Costa',
+                'email_adh' => 'astrid64@masse.fr',
+                'login_adh' => 'olivier.pierre',
+                'mdp_adh' => '.4y/J>yN_QUh7Bw@NW>)',
+                'mdp_adh2' => '.4y/J>yN_QUh7Bw@NW>)',
+                'bool_admin_adh' => false,
+                'bool_exempt_adh' => false,
+                'bool_display_info' => false,
+                'sexe_adh' => 2,
+                'prof_adh' => 'Conseiller relooking',
+                'titre_adh' => null,
+                'ddn_adh' => '1989-10-31',
+                'lieu_naissance' => 'Collet',
+                'pseudo_adh' => 'agnes.evrard',
+                'pays_adh' => null,
+                'tel_adh' => '0288284193',
+                'url_adh' => 'https://leroux.fr/omnis-autem-suscipit-consequuntur-possimus-sint-iste-beatae.html',
+                'activite_adh' => true,
+                'id_statut' => 9,
+                'date_crea_adh' => '2019-11-29',
+                'pref_lang' => 'oc',
+                'fingerprint' => 'FAKER_1',
+            ),
+            'FAKER_2' =>  array (
+                'nom_adh' => 'Lemaire',
+                'prenom_adh' => 'Georges',
+                'ville_adh' => 'Teixeira-sur-Mer',
+                'cp_adh' => '40141',
+                'adresse_adh' => 'place Guillaume',
+                'email_adh' => 'lefort.vincent@club-internet.fr',
+                'login_adh' => 'josette46',
+                'mdp_adh' => '(IqBaAIR',
+                'mdp_adh2' => '(IqBaAIR',
+                'bool_admin_adh' => false,
+                'bool_exempt_adh' => false,
+                'bool_display_info' => true,
+                'sexe_adh' => 0,
+                'prof_adh' => 'Assistant logistique',
+                'titre_adh' => null,
+                'ddn_adh' => '1935-09-07',
+                'lieu_naissance' => 'Ponsboeuf',
+                'pseudo_adh' => 'fgay',
+                'pays_adh' => null,
+                'tel_adh' => '+33 7 45 45 19 81',
+                'url_adh' => null,
+                'activite_adh' => true,
+                'id_statut' => 8,
+                'date_crea_adh' => '2019-02-03',
+                'pref_lang' => 'uk',
+                'fingerprint' => 'FAKER_2',
+            ),
+            'FAKER_3' =>  array (
+                'nom_adh' => 'Paul',
+                'prenom_adh' => 'Thibaut',
+                'ville_adh' => 'Mallet-sur-Prevost',
+                'cp_adh' => '50537',
+                'adresse_adh' => '246, boulevard Daniel Mendes',
+                'email_adh' => 'ihamel@pinto.fr',
+                'login_adh' => 'josephine.fabre',
+                'mdp_adh' => '`2LrQcb9Utgm=Y\\S$',
+                'mdp_adh2' => '`2LrQcb9Utgm=Y\\S$',
+                'bool_admin_adh' => false,
+                'bool_exempt_adh' => false,
+                'bool_display_info' => true,
+                'sexe_adh' => 0,
+                'prof_adh' => 'Aide à domicile',
+                'titre_adh' => null,
+                'ddn_adh' => '1961-09-17',
+                'lieu_naissance' => 'Gomez',
+                'pseudo_adh' => 'chauvin.guillaume',
+                'pays_adh' => 'Hong Kong',
+                'tel_adh' => '+33 5 48 57 32 28',
+                'url_adh' => null,
+                'activite_adh' => true,
+                'id_statut' => 1,
+                'date_crea_adh' => '2017-11-20',
+                'pref_lang' => 'nb_NO',
+                'fingerprint' => 'FAKER_3',
+                'societe_adh' => 'Jacques',
+                'is_company' => true,
+            ),
+            'FAKER_4' =>  array (
+                'nom_adh' => 'Pascal',
+                'prenom_adh' => 'Isaac',
+                'ville_adh' => 'Jourdanboeuf',
+                'cp_adh' => '93966',
+                'adresse_adh' => '5, boulevard de Boucher',
+                'email_adh' => 'valerie.becker@gmail.com',
+                'login_adh' => 'lucie08',
+                'mdp_adh' => '|%+wtMW{l',
+                'mdp_adh2' => '|%+wtMW{l',
+                'bool_admin_adh' => false,
+                'bool_exempt_adh' => false,
+                'bool_display_info' => true,
+                'sexe_adh' => 1,
+                'prof_adh' => 'Bruiteur',
+                'titre_adh' => null,
+                'ddn_adh' => '1953-12-11',
+                'lieu_naissance' => 'Foucher',
+                'pseudo_adh' => 'sauvage.dorothee',
+                'pays_adh' => 'Bangladesh',
+                'tel_adh' => '+33 4 75 14 66 56',
+                'url_adh' => null,
+                'activite_adh' => false,
+                'id_statut' => 9,
+                'date_crea_adh' => '2018-08-16',
+                'pref_lang' => 'en_US',
+                'fingerprint' => 'FAKER_4',
+            ),
+            'FAKER_5' =>  array (
+                'nom_adh' => 'Morvan',
+                'prenom_adh' => 'Joseph',
+                'ville_adh' => 'Noel',
+                'cp_adh' => '05069',
+                'adresse_adh' => 'place de Barthelemy',
+                'email_adh' => 'claunay@tele2.fr',
+                'login_adh' => 'marthe.hoarau',
+                'mdp_adh' => '\'C?}vJAU>:-iE',
+                'mdp_adh2' => '\'C?}vJAU>:-iE',
+                'bool_admin_adh' => false,
+                'bool_exempt_adh' => false,
+                'bool_display_info' => true,
+                'sexe_adh' => 1,
+                'prof_adh' => 'Opérateur du son',
+                'titre_adh' => null,
+                'ddn_adh' => '1938-05-11',
+                'lieu_naissance' => 'Beguedan',
+                'pseudo_adh' => 'andre.guillou',
+                'pays_adh' => null,
+                'tel_adh' => '09 26 70 06 55',
+                'url_adh' => 'http://www.hoarau.fr/quis-neque-ducimus-quidem-et',
+                'activite_adh' => true,
+                'id_statut' => 9,
+                'date_crea_adh' => '2018-09-28',
+                'pref_lang' => 'ca',
+                'fingerprint' => 'FAKER_5',
+            ),
+            'FAKER_6' =>  array (
+                'nom_adh' => 'Lebreton',
+                'prenom_adh' => 'Emmanuelle',
+                'ville_adh' => 'Lefevre',
+                'cp_adh' => '29888',
+                'adresse_adh' => '98, rue Moulin',
+                'email_adh' => 'zacharie77@ruiz.fr',
+                'login_adh' => 'marianne.collin',
+                'mdp_adh' => '=jG{wyE',
+                'mdp_adh2' => '=jG{wyE',
+                'bool_admin_adh' => false,
+                'bool_exempt_adh' => false,
+                'bool_display_info' => true,
+                'sexe_adh' => 1,
+                'prof_adh' => 'Galeriste',
+                'titre_adh' => null,
+                'ddn_adh' => '2001-02-01',
+                'lieu_naissance' => 'Berthelot',
+                'pseudo_adh' => 'ferreira.rene',
+                'pays_adh' => 'Tuvalu',
+                'tel_adh' => '+33 (0)7 47 56 89 70',
+                'url_adh' => null,
+                'activite_adh' => true,
+                'id_statut' => 9,
+                'date_crea_adh' => '2018-01-13',
+                'pref_lang' => 'es',
+                'fingerprint' => 'FAKER_6',
+            ),
+            'FAKER_7' =>  array (
+                'nom_adh' => 'Maurice',
+                'prenom_adh' => 'Capucine',
+                'ville_adh' => 'Renaultdan',
+                'cp_adh' => '59 348',
+                'adresse_adh' => '56, avenue Grenier',
+                'email_adh' => 'didier.emmanuel@tiscali.fr',
+                'login_adh' => 'william.herve',
+                'mdp_adh' => '#7yUz#qToZ\'',
+                'mdp_adh2' => '#7yUz#qToZ\'',
+                'bool_admin_adh' => false,
+                'bool_exempt_adh' => false,
+                'bool_display_info' => true,
+                'sexe_adh' => 1,
+                'prof_adh' => 'Cintrier-machiniste',
+                'titre_adh' => null,
+                'ddn_adh' => '1984-04-17',
+                'lieu_naissance' => 'Rolland',
+                'pseudo_adh' => 'roger27',
+                'pays_adh' => 'Antilles néerlandaises',
+                'tel_adh' => '0922523762',
+                'url_adh' => null,
+                'activite_adh' => true,
+                'id_statut' => 9,
+                'date_crea_adh' => '2020-02-13',
+                'pref_lang' => 'br',
+                'fingerprint' => 'FAKER_7',
+                'societe_adh' => 'Mace',
+                'is_company' => true,
+            ),
+            'FAKER_8' =>  array (
+                'nom_adh' => 'Hubert',
+                'prenom_adh' => 'Lucy',
+                'ville_adh' => 'Lagarde',
+                'cp_adh' => '22 829',
+                'adresse_adh' => '3, rue Pénélope Marie',
+                'email_adh' => 'zoe02@morvan.com',
+                'login_adh' => 'bernard.agathe',
+                'mdp_adh' => '@9di}eJyc"0s_d(',
+                'mdp_adh2' => '@9di}eJyc"0s_d(',
+                'bool_admin_adh' => false,
+                'bool_exempt_adh' => false,
+                'bool_display_info' => true,
+                'sexe_adh' => 2,
+                'prof_adh' => 'Facteur',
+                'titre_adh' => null,
+                'ddn_adh' => '2008-01-13',
+                'lieu_naissance' => 'Ribeiro',
+                'pseudo_adh' => 'julien.isabelle',
+                'pays_adh' => 'Mexique',
+                'tel_adh' => '0809527977',
+                'url_adh' => null,
+                'activite_adh' => true,
+                'id_statut' => 9,
+                'date_crea_adh' => '2019-06-26',
+                'pref_lang' => 'de_DE',
+                'fingerprint' => 'FAKER_8',
+            ),
+            'FAKER_9' =>  array (
+                'nom_adh' => 'Goncalves',
+                'prenom_adh' => 'Corinne',
+                'ville_adh' => 'LesageVille',
+                'cp_adh' => '15728',
+                'adresse_adh' => '18, rue de Pinto',
+                'email_adh' => 'julien.clement@dbmail.com',
+                'login_adh' => 'xavier.nicolas',
+                'mdp_adh' => '<W0XdOj2Gp|@;W}gWh]',
+                'mdp_adh2' => '<W0XdOj2Gp|@;W}gWh]',
+                'bool_admin_adh' => false,
+                'bool_exempt_adh' => false,
+                'bool_display_info' => true,
+                'sexe_adh' => 1,
+                'prof_adh' => 'Eleveur de volailles',
+                'titre_adh' => null,
+                'ddn_adh' => '2013-09-12',
+                'lieu_naissance' => 'Breton',
+                'pseudo_adh' => 'louis.pruvost',
+                'pays_adh' => null,
+                'tel_adh' => '+33 (0)6 80 24 46 58',
+                'url_adh' => null,
+                'activite_adh' => true,
+                'id_statut' => 9,
+                'date_crea_adh' => '2020-08-09',
+                'pref_lang' => 'br',
+                'fingerprint' => 'FAKER_9',
+            )
+        );
+    }
+
+    /**
+     * Get second set of member data
+     * two lines without name.
+     *
+     * @return array
+     */
+    private function getMemberData2()
+    {
+        return array (
+            'FAKER_0' => array (
+                'nom_adh' => 'Goncalves',
+                'prenom_adh' => 'Margot',
+                'ville_adh' => 'Alves',
+                'cp_adh' => '76254',
+                'adresse_adh' => '43, impasse Maurice Imbert',
+                'email_adh' => 'guillou.richard@yahoo.fr',
+                'login_adh' => 'suzanne.mathieu',
+                'mdp_adh' => 'Thihk2z0',
+                'mdp_adh2' => 'Thihk2z0',
+                'bool_admin_adh' => false,
+                'bool_exempt_adh' => false,
+                'bool_display_info' => true,
+                'sexe_adh' => 2,
+                'prof_adh' => 'Cueilleur de cerises',
+                'titre_adh' => null,
+                'ddn_adh' => '2020-04-24',
+                'lieu_naissance' => 'Poulain-les-Bains',
+                'pseudo_adh' => 'olivier.roux',
+                'pays_adh' => 'République Dominicaine',
+                'tel_adh' => '08 95 04 73 14',
+                'url_adh' => null,
+                'activite_adh' => true,
+                'id_statut' => 9,
+                'date_crea_adh' => '2020-07-31',
+                'pref_lang' => 'ca',
+                'fingerprint' => 'FAKER_0',
+            ),
+            'FAKER_1' => array (
+                'nom_adh' => 'Da Silva',
+                'prenom_adh' => 'Augustin',
+                'ville_adh' => 'Perrin-sur-Masson',
+                'cp_adh' => '31519',
+                'adresse_adh' => '154, place Boulay',
+                'email_adh' => 'marc60@moreno.fr',
+                'login_adh' => 'hoarau.maryse',
+                'mdp_adh' => '\\9Si%r/FAmz.HE4!{Q\\',
+                'mdp_adh2' => '\\9Si%r/FAmz.HE4!{Q\\',
+                'bool_admin_adh' => false,
+                'bool_exempt_adh' => false,
+                'bool_display_info' => true,
+                'sexe_adh' => 2,
+                'prof_adh' => 'Séismologue',
+                'titre_adh' => null,
+                'ddn_adh' => '1988-06-26',
+                'lieu_naissance' => 'Martel',
+                'pseudo_adh' => 'hchevalier',
+                'pays_adh' => 'Kiribati',
+                'tel_adh' => '04 55 49 80 92',
+                'url_adh' => 'http://www.leblanc.com/nemo-non-rerum-commodi-sequi-ut',
+                'activite_adh' => true,
+                'id_statut' => 1,
+                'date_crea_adh' => '2020-06-02',
+                'pref_lang' => 'fr_FR',
+                'fingerprint' => 'FAKER_1',
+            ),
+            'FAKER_2' => array (
+                'nom_adh' => 'Doe',
+                'prenom_adh' => 'Laetitia',
+                'ville_adh' => 'SimonBourg',
+                'cp_adh' => '90351',
+                'adresse_adh' => '147, chemin de Chauvet',
+                'email_adh' => 'jean.joseph@pinto.fr',
+                'login_adh' => 'marianne.bourgeois',
+                'mdp_adh' => '[oT:"ExE',
+                'mdp_adh2' => '[oT:"ExE',
+                'bool_admin_adh' => false,
+                'bool_exempt_adh' => false,
+                'bool_display_info' => true,
+                'sexe_adh' => 0,
+                'prof_adh' => 'Porteur de hottes',
+                'titre_adh' => null,
+                'ddn_adh' => '2010-03-13',
+                'lieu_naissance' => 'Gallet',
+                'pseudo_adh' => 'abarre',
+                'pays_adh' => 'Kirghizistan',
+                'tel_adh' => '07 47 63 11 31',
+                'url_adh' => 'https://www.jacques.com/fuga-voluptatem-tenetur-rem-possimus',
+                'activite_adh' => true,
+                'id_statut' => 9,
+                'date_crea_adh' => '2020-10-28',
+                'pref_lang' => 'ar',
+                'fingerprint' => 'FAKER_2',
+            ),
+            'FAKER_3' => array (
+                'nom_adh' => 'Cordier',
+                'prenom_adh' => 'Olivier',
+                'ville_adh' => 'Lacroixboeuf',
+                'cp_adh' => '58 787',
+                'adresse_adh' => '77, place Gilbert Perrier',
+                'email_adh' => 'adelaide07@yahoo.fr',
+                'login_adh' => 'riou.sebastien',
+                'mdp_adh' => '%"OC/UniE46',
+                'mdp_adh2' => '%"OC/UniE46',
+                'bool_admin_adh' => false,
+                'bool_exempt_adh' => false,
+                'bool_display_info' => false,
+                'sexe_adh' => 2,
+                'prof_adh' => 'Oenologue',
+                'titre_adh' => null,
+                'ddn_adh' => '2010-10-08',
+                'lieu_naissance' => 'Leger',
+                'pseudo_adh' => 'frederique.bernier',
+                'pays_adh' => null,
+                'tel_adh' => '+33 2 50 03 01 12',
+                'url_adh' => null,
+                'activite_adh' => true,
+                'id_statut' => 9,
+                'date_crea_adh' => '2020-08-14',
+                'pref_lang' => 'ar',
+                'fingerprint' => 'FAKER_3',
+            ),
+            'FAKER_4' => array (
+                'nom_adh' => 'Robert',
+                'prenom_adh' => 'Grégoire',
+                'ville_adh' => 'Delannoy-sur-Mer',
+                'cp_adh' => '41185',
+                'adresse_adh' => '15, boulevard de Pierre',
+                'email_adh' => 'normand.matthieu@orange.fr',
+                'login_adh' => 'guilbert.louis',
+                'mdp_adh' => 'y(,HodJF*j',
+                'mdp_adh2' => 'y(,HodJF*j',
+                'bool_admin_adh' => false,
+                'bool_exempt_adh' => false,
+                'bool_display_info' => true,
+                'sexe_adh' => 2,
+                'prof_adh' => 'Mannequin détail',
+                'titre_adh' => null,
+                'ddn_adh' => '1974-05-14',
+                'lieu_naissance' => 'Barbe-sur-Laurent',
+                'pseudo_adh' => 'stoussaint',
+                'pays_adh' => 'Îles Mineures Éloignées des États-Unis',
+                'tel_adh' => '+33 (0)1 30 50 01 54',
+                'url_adh' => 'http://www.lemaitre.org/dolorum-recusandae-non-eum-non',
+                'activite_adh' => true,
+                'id_statut' => 3,
+                'date_crea_adh' => '2018-12-05',
+                'pref_lang' => 'it_IT',
+                'fingerprint' => 'FAKER_4',
+                'societe_adh' => 'Chretien Martineau S.A.',
+                'is_company' => true,
+            ),
+            'FAKER_5' =>  array (
+                'nom_adh' => 'Doe',
+                'prenom_adh' => 'Charles',
+                'ville_adh' => 'Charpentier-sur-Lebrun',
+                'cp_adh' => '99129',
+                'adresse_adh' => '817, chemin de Bonnin',
+                'email_adh' => 'guillou.augustin@live.com',
+                'login_adh' => 'dominique80',
+                'mdp_adh' => '~g??E0HE$A>2"e*C7+Kw',
+                'mdp_adh2' => '~g??E0HE$A>2"e*C7+Kw',
+                'bool_admin_adh' => true,
+                'bool_exempt_adh' => false,
+                'bool_display_info' => true,
+                'sexe_adh' => 0,
+                'prof_adh' => 'Commandant de police',
+                'titre_adh' => null,
+                'ddn_adh' => '2007-03-26',
+                'lieu_naissance' => 'Boutin',
+                'pseudo_adh' => 'virginie.jacquet',
+                'pays_adh' => null,
+                'tel_adh' => '0393209420',
+                'url_adh' => null,
+                'activite_adh' => true,
+                'id_statut' => 9,
+                'date_crea_adh' => '2018-02-17',
+                'pref_lang' => 'fr_FR',
+                'fingerprint' => 'FAKER_5',
+            ),
+            'FAKER_6' => array (
+                'nom_adh' => 'Thierry',
+                'prenom_adh' => 'Louis',
+                'ville_adh' => 'Henry',
+                'cp_adh' => '98 144',
+                'adresse_adh' => '383, avenue Éléonore Bouchet',
+                'email_adh' => 'bernard.elodie@orange.fr',
+                'login_adh' => 'ubreton',
+                'mdp_adh' => 'lTBT@,hsE`co?C2=',
+                'mdp_adh2' => 'lTBT@,hsE`co?C2=',
+                'bool_admin_adh' => false,
+                'bool_exempt_adh' => false,
+                'bool_display_info' => false,
+                'sexe_adh' => 2,
+                'prof_adh' => 'Endocrinologue',
+                'titre_adh' => null,
+                'ddn_adh' => '1994-07-19',
+                'lieu_naissance' => 'Pagesdan',
+                'pseudo_adh' => 'diallo.sebastien',
+                'pays_adh' => null,
+                'tel_adh' => '+33 5 72 28 24 81',
+                'url_adh' => null,
+                'activite_adh' => true,
+                'id_statut' => 9,
+                'date_crea_adh' => '2020-03-16',
+                'pref_lang' => 'en_US',
+                'fingerprint' => 'FAKER_6',
+            ),
+            'FAKER_7' =>  array (
+                'nom_adh' => 'Delattre',
+                'prenom_adh' => 'Susanne',
+                'ville_adh' => 'Roche-les-Bains',
+                'cp_adh' => '37 104',
+                'adresse_adh' => '44, rue Suzanne Guilbert',
+                'email_adh' => 'tmartel@wanadoo.fr',
+                'login_adh' => 'lebreton.alexandre',
+                'mdp_adh' => '{(3mCWC7[YL]n',
+                'mdp_adh2' => '{(3mCWC7[YL]n',
+                'bool_admin_adh' => false,
+                'bool_exempt_adh' => false,
+                'bool_display_info' => true,
+                'sexe_adh' => 0,
+                'prof_adh' => 'Gérant d\'hôtel',
+                'titre_adh' => null,
+                'ddn_adh' => '1914-05-16',
+                'lieu_naissance' => 'Traore',
+                'pseudo_adh' => 'helene59',
+                'pays_adh' => null,
+                'tel_adh' => '0383453389',
+                'url_adh' => 'http://www.lesage.com/et-aperiam-labore-est-libero-voluptatem.html',
+                'activite_adh' => true,
+                'id_statut' => 9,
+                'date_crea_adh' => '2020-02-03',
+                'pref_lang' => 'oc',
+                'fingerprint' => 'FAKER_7',
+            ),
+            'FAKER_8' =>  array (
+                'nom_adh' => 'Peltier',
+                'prenom_adh' => 'Inès',
+                'ville_adh' => 'Thierry-sur-Carre',
+                'cp_adh' => '80690',
+                'adresse_adh' => '43, impasse Texier',
+                'email_adh' => 'qdubois@mendes.fr',
+                'login_adh' => 'julie.carlier',
+                'mdp_adh' => '.ATai-E6%LIxE{',
+                'mdp_adh2' => '.ATai-E6%LIxE{',
+                'bool_admin_adh' => false,
+                'bool_exempt_adh' => false,
+                'bool_display_info' => true,
+                'sexe_adh' => 1,
+                'prof_adh' => 'Gynécologue',
+                'titre_adh' => null,
+                'ddn_adh' => '1988-05-29',
+                'lieu_naissance' => 'Dijoux-sur-Michaud',
+                'pseudo_adh' => 'wpierre',
+                'pays_adh' => null,
+                'tel_adh' => '01 32 14 47 74',
+                'url_adh' => null,
+                'activite_adh' => true,
+                'id_statut' => 9,
+                'date_crea_adh' => '2020-03-28',
+                'pref_lang' => 'ar',
+                'fingerprint' => 'FAKER_8',
+            ),
+            'FAKER_9' => array (
+                'nom_adh' => 'Marchand',
+                'prenom_adh' => 'Audrey',
+                'ville_adh' => 'Lenoirdan',
+                'cp_adh' => '06494',
+                'adresse_adh' => '438, place de Carre',
+                'email_adh' => 'luc42@yahoo.fr',
+                'login_adh' => 'margot.bousquet',
+                'mdp_adh' => 'FH,q5udclwM(',
+                'mdp_adh2' => 'FH,q5udclwM(',
+                'bool_admin_adh' => false,
+                'bool_exempt_adh' => false,
+                'bool_display_info' => true,
+                'sexe_adh' => 1,
+                'prof_adh' => 'Convoyeur garde',
+                'titre_adh' => null,
+                'ddn_adh' => '1977-09-02',
+                'lieu_naissance' => 'Arnaud-sur-Antoine',
+                'pseudo_adh' => 'gerard66',
+                'pays_adh' => null,
+                'tel_adh' => '+33 1 46 04 81 87',
+                'url_adh' => 'http://www.thierry.com/',
+                'activite_adh' => true,
+                'id_statut' => 5,
+                'date_crea_adh' => '2019-05-16',
+                'pref_lang' => 'fr_FR',
+                'fingerprint' => 'FAKER_9',
+            )
+        );
+    }
+
+    /**
+     * Get second set of member data but two lines without name.
+     *
+     * @return array
+     */
+    private function getMemberData2NoName()
+    {
+        $data = $this->getMemberData2();
+        $data['FAKER_2']['nom_adh'] = '';
+        $data['FAKER_5']['nom_adh'] = '';
+        return $data;
+    }
 }
index 1aa0cf2863313140c09e3b08a9b86d2fc59c844c..38e7642e47a531b0c0f2071f65e6dd70b19d929d 100644 (file)
@@ -199,8 +199,6 @@ class CheckAcls extends atoum
             ['ajaxMembers', 'groupmanager'],
             ['ajaxGroupMembers', 'staff'],
             ['getDynamicFile', 'member'],
-            ['fakeData', 'superadmin'],
-            ['doFakeData', 'superadmin'],
             ['adminTools', 'superadmin'],
             ['doAdminTools', 'superadmin'],
             ['telemetryInfos', 'admin'],
index 9e1eb6d24d0e42f942b80ba79ff784c030bf48d2..b184ab732a2e75614f2a5a9e1ebf5322cc41c1e1 100644 (file)
@@ -505,17 +505,36 @@ class Reminders extends atoum
      */
     private function createAdherent()
     {
-        $fakedata = new \Galette\Util\FakeData($this->zdb, $this->i18n);
-        $fakedata
-            ->setSeed($this->seed)
-            ->setDependencies(
-                $this->preferences,
-                $this->members_fields,
-                $this->history,
-                $this->login
-            );
-
-        $data = $fakedata->fakeMember();
+        $data = [
+            'nom_adh' => 'Hoarau',
+            'prenom_adh' => 'Lucas',
+            'ville_adh' => 'Reynaudnec',
+            'cp_adh' => '63077',
+            'adresse_adh' => '2, boulevard Legros',
+            'email_adh' => 'phoarau@tele2.fr',
+            'login_adh' => 'nathalie51',
+            'mdp_adh' => 'T.u!IbKOi|06',
+            'mdp_adh2' => 'T.u!IbKOi|06',
+            'bool_admin_adh' => false,
+            'bool_exempt_adh' => false,
+            'bool_display_info' => false,
+            'sexe_adh' => 1,
+            'prof_adh' => 'Extraction',
+            'titre_adh' => null,
+            'ddn_adh' => '1992-09-13',
+            'lieu_naissance' => 'Fischer',
+            'pseudo_adh' => 'vallet.camille',
+            'pays_adh' => null,
+            'tel_adh' => '05 59 53 59 43',
+            'url_adh' => 'http://bodin.net/omnis-ratione-sint-dolorem-architecto',
+            'activite_adh' => true,
+            'id_statut' => 9,
+            'date_crea_adh' => '2019-05-20',
+            'pref_lang' => 'ca',
+            'fingerprint' => 'FAKER' . $this->seed,
+            'societe_adh' => 'Philippe',
+            'is_company' => true,
+        ];
         $this->createMember($data);
         $this->checkMemberExpected();
     }