3 /* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */
10 * Copyright © 2020 The Galette Team
12 * This file is part of Galette (http://galette.tuxfamily.org).
14 * Galette is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU General Public License as published by
16 * the Free Software Foundation, either version 3 of the License, or
17 * (at your option) any later version.
19 * Galette is distributed in the hope that it will be useful,
20 * but WITHOUT ANY WARRANTY; without even the implied warranty of
21 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22 * GNU General Public License for more details.
24 * You should have received a copy of the GNU General Public License
25 * along with Galette. If not, see <http://www.gnu.org/licenses/>.
28 * @package GaletteTests
30 * @author Johan Cwiklinski <johan@x-tnd.be>
31 * @copyright 2020 The Galette Team
32 * @license http://www.gnu.org/licenses/gpl-3.0.html GPL License 3.0 or (at your option) any later version
34 * @link http://galette.tuxfamily.org
38 namespace Galette\IO\test\units
;
41 use Galette\Entity\Adherent
;
42 use Galette\DynamicFields\DynamicField
;
49 * @package GaletteTests
50 * @author Johan Cwiklinski <johan@x-tnd.be>
51 * @copyright 2020 The Galette Team
52 * @license http://www.gnu.org/licenses/gpl-3.0.html GPL License 3.0 or (at your option) any later version
53 * @link http://galette.tuxfamily.org
56 class CsvIn
extends atoum
65 private $members_fields;
66 private $members_form_fields;
67 private $members_fields_cats;
73 private $mocked_router;
74 private $contents_table = null;
79 * @param string $testMethod Calling method
83 public function beforeTestMethod($testMethod)
85 $this->contents_table
= null;
86 $this->mocked_router
= new \mock\Slim\
Router();
87 $this->calling($this->mocked_router
)->pathFor
= function ($name, $params) {
90 $this->zdb
= new \Galette\Core\
Db();
91 $this->i18n
= new \Galette\Core\
I18n(
92 \Galette\Core\I18n
::DEFAULT_LANG
94 $this->preferences
= new \Galette\Core\
Preferences(
97 $this->session
= new \RKA\
Session();
98 $this->login
= new \Galette\Core\
Login($this->zdb
, $this->i18n
, $this->session
);
99 $this->history
= new \Galette\Core\
History($this->zdb
, $this->login
, $this->preferences
);
101 $this->flash_data
= &$flash_data;
102 $this->flash
= new \Slim\Flash\
Messages($flash_data);
104 global $zdb, $i18n, $login, $hist;
107 $login = $this->login
;
108 $hist = $this->history
;
110 $app = new \Slim\
App(['router' => $this->mocked_router
, 'flash' => $this->flash
]);
111 $container = $app->getContainer();
112 /*$this->view = new \mock\Slim\Views\Smarty(
113 rtrim(GALETTE_ROOT . GALETTE_TPL_SUBDIR, DIRECTORY_SEPARATOR),
115 'cacheDir' => rtrim(GALETTE_CACHE_DIR, DIRECTORY_SEPARATOR),
116 'compileDir' => rtrim(GALETTE_COMPILE_DIR, DIRECTORY_SEPARATOR),
118 GALETTE_ROOT . 'includes/smarty_plugins'
122 $this->calling($this->view)->render = function ($response) {
123 $response->getBody()->write('Atoum view rendered');
127 $this->view->addSlimPlugins($container->get('router'), '/');
128 //$container['view'] = $this->view;*/
129 $container['view'] = null;
130 $container['zdb'] = $zdb;
131 $container['login'] = $this->login
;
132 $container['session'] = $this->session
;
133 $container['preferences'] = $this->preferences
;
134 $container['logo'] = null;
135 $container['print_logo'] = null;
136 $container['plugins'] = null;
137 $container['history'] = $this->history
;
138 $container['i18n'] = null;
139 $container['fields_config'] = null;
140 $container['lists_config'] = null;
141 $container['l10n'] = null;
142 include_once GALETTE_ROOT
. 'includes/fields_defs/members_fields.php';
143 $this->members_fields
= $members_fields;
144 $container['members_fields'] = $this->members_fields
;
145 $members_form_fields = $members_fields;
146 foreach ($members_form_fields as $k => $field) {
147 if ($field['position'] == -1) {
148 unset($members_form_fields[$k]);
151 $this->members_form_fields
= $members_form_fields;
152 $container['members_form_fields'] = $this->members_form_fields
;
153 include_once GALETTE_ROOT
. 'includes/fields_defs/members_fields_cats.php';
154 $this->members_fields_cats
= $members_fields_cats;
155 $container['members_fields_cats'] = $this->members_fields_cats
;
156 $this->container
= $container;
157 $this->request
= $container->get('request');
158 $this->response
= $container->get('response');
164 * @param string $testMethod Calling method
168 public function afterTestMethod($testMethod)
170 $delete = $this->zdb
->delete(\Galette\Entity\Adherent
::TABLE
);
171 $this->zdb
->execute($delete);
172 $delete = $this->zdb
->delete(\Galette\Entity\DynamicFieldsHandle
::TABLE
);
173 $this->zdb
->execute($delete);
174 $delete = $this->zdb
->delete(DynamicField
::TABLE
);
175 $this->zdb
->execute($delete);
176 //cleanup dynamic translations
177 $delete = $this->zdb
->delete(\Galette\Core\L10n
::TABLE
);
180 'Dynamic choice field',
181 'Dynamic date field',
185 $this->zdb
->execute($delete);
187 if ($this->contents_table
!== null) {
188 $this->zdb
->drop($this->contents_table
);
193 * Import text CSV file
195 * @param array $fields Fields name to use at import
196 * @param string $file_name File name
197 * @param array $flash_messages Excpeted flash messages from doImport route
198 * @param airay $members_list List of faked members data
199 * @param integer $count_before Count before insertions. Defaults to 0 if null.
200 * @param integer $count_after Count after insertions. Default to $count_before + count $members_list
201 * @param array $values Textual values for dynamic choices fields
205 private function doImportFileTest(
208 array $flash_messages,
210 $count_before = null,
214 if ($count_before === null) {
217 if ($count_after === null) {
218 $count_after = $count_before +
count($members_list);
221 $members = new \Galette\Repository\
Members();
222 $list = $members->getList();
223 $this->integer($list->count())->isIdenticalTo(
225 print_r(debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS
, 1), true)
228 $model = $this->getModel($fields);
230 //get csv model file to add data in
231 $controller = new \Galette\Controllers\
CsvController($this->container
);
232 $response = $controller->getImportModel($this->request
, $this->response
);
233 $csvin = new \galette\IO\
CsvIn($this->zdb
);
235 $this->integer($response->getStatusCode())->isIdenticalTo(200);
236 $this->array($response->getHeaders())
237 ->array['Content-Type']->isIdenticalTo(['text/csv'])
238 ->array['Content-Disposition']->isIdenticalTo(['attachment;filename="galette_import_model.csv"']);
240 $csvfile_model = $response->getBody()->__toString();
241 $this->string($csvfile_model)
242 ->isIdenticalTo("\"" . implode("\";\"", $fields) . "\"\r\n");
244 $contents = $csvfile_model;
245 foreach ($members_list as $member) {
247 foreach ($fields as $field) {
248 $amember[$field] = $member[$field];
250 $contents .= "\"" . implode("\";\"", $amember) . "\"\r\n";
253 $path = GALETTE_CACHE_DIR
. $file_name;
254 $this->integer(file_put_contents($path, $contents));
255 $_FILES['new_file'] = [
256 'error' => UPLOAD_ERR_OK
,
257 'name' => $file_name,
259 'size' => filesize($path)
261 $this->boolean($csvin->store($_FILES['new_file'], true))->isTrue();
262 $this->boolean(file_exists($csvin->getDestDir() . $csvin->getFileName()))->isTrue();
265 'import_file' => $file_name
268 $request = clone $this->request
;
269 $request = $request->withParsedBody($post);
271 $response = $controller->doImports($request, $this->response
);
272 $this->integer($response->getStatusCode())->isIdenticalTo(301);
273 $this->array($this->flash_data
['slimFlash'])->isIdenticalTo($flash_messages);
274 $this->flash
->clearMessages();
276 $members = new \Galette\Repository\
Members();
277 $list = $members->getList();
278 $this->integer($list->count())->isIdenticalTo($count_after);
280 if ($count_before != $count_after) {
281 foreach ($list as $member) {
282 $created = $members_list[$member->fingerprint
];
283 foreach ($fields as $field) {
284 if (property_exists($member, $field)) {
285 $this->variable($member->$field)->isEqualTo($created[$field]);
287 //manage dynamic fields
289 if (preg_match('/^dynfield_(\d+)/', $field, $matches)) {
290 $adh = new Adherent($this->zdb
, (int)$member->id_adh
, ['dynamics' => true]);
293 'item_id' => $adh->id
,
294 'field_form' => 'adh',
296 'field_val' => $created[$field]
300 $dfield = $adh->getDynamicFields()->getValues($matches[1]);
301 if (isset($dfield[0]['text_val'])) {
302 //choice, add textual value
303 $expected[0]['text_val'] = $values[$created[$field]];
306 $this->array($adh->getDynamicFields()->getValues($matches[1]))->isEqualTo($expected);
308 throw new \
RuntimeException("Unknown field $field");
317 * Test CSV import loading
321 public function testImport()
323 $fields = ['nom_adh', 'ville_adh', 'bool_exempt_adh', 'fingerprint'];
324 $file_name = 'test-import-atoum.csv';
326 'success_detected' => ["File '$file_name' has been successfully imported :)"]
328 $members_list = $this->getMemberData1();
332 $this->doImportFileTest($fields, $file_name, $flash_messages, $members_list, $count_before, $count_after);
335 $file_name = 'test-import-atoum-noname.csv';
337 'error_detected' => [
338 'File does not comply with requirements.',
339 'Field nom_adh is required, but missing in row 3'
343 $members_list = $this->getMemberData2NoName();
347 $this->doImportFileTest($fields, $file_name, $flash_messages, $members_list, $count_before, $count_after);
351 * Get CSV import model
353 * @param array $fields Fields list
355 * @return \Galette\Entity\ImportModel
357 protected function getModel($fields): \Galette\Entity\ImportModel
359 $model = new \Galette\Entity\
ImportModel();
360 $this->boolean($model->remove($this->zdb
))->isTrue();
362 $this->object($model->setFields($fields))->isInstanceOf('Galette\Entity\ImportModel');
363 $this->boolean($model->store($this->zdb
))->isTrue();
364 $this->boolean($model->load())->isTrue();
369 * Test dynamic translation has been added properly
371 * @param string $text_orig Original text
372 * @param string $lang Lang text has been added in
376 protected function checkDynamicTranslation($text_orig, $lang = 'fr_FR.utf8')
378 $langs = array_keys($this->i18n
->langs
);
379 $select = $this->zdb
->select(\Galette\Core\L10n
::TABLE
);
385 $select->where(['text_orig' => $text_orig]);
386 $results = $this->zdb
->execute($select);
387 $this->integer($results->count())->isIdenticalTo(count($langs));
389 foreach ($results as $result) {
390 $this->boolean(in_array(str_replace('.utf8', '', $result['text_locale']), $langs))->isTrue();
391 $this->integer((int)$result['text_nref'])->isIdenticalTo(1);
392 $this->string($result['text_trans'])->isIdenticalTo(
393 ($result['text_locale'] == 'fr_FR.utf8' ?
$text_orig : '')
399 * Test import with dynamic fields
403 public function testImportDynamics()
407 'form_name' => 'adh',
408 'field_name' => 'Dynamic text field',
409 'field_perm' => DynamicField
::PERM_USER_WRITE
,
410 'field_type' => DynamicField
::TEXT
,
411 'field_required' => 1,
415 $df = DynamicField
::getFieldType($this->zdb
, $field_data['field_type']);
417 $stored = $df->store($field_data);
418 $error_detected = $df->getErrors();
419 $warning_detected = $df->getWarnings();
420 $this->boolean($stored)->isTrue(
423 $df->getErrors() +
$df->getWarnings()
426 $this->array($error_detected)->isEmpty(implode(' ', $df->getErrors()));
427 $this->array($warning_detected)->isEmpty(implode(' ', $df->getWarnings()));
428 //check if dynamic translation has been added
429 $this->checkDynamicTranslation($field_data['field_name']);
431 $select = $this->zdb
->select(DynamicField
::TABLE
);
432 $select->columns(array('num' => new \Laminas\Db\Sql\
Expression('COUNT(1)')));
433 $result = $this->zdb
->execute($select)->current();
434 $this->integer((int)$result->num
)->isIdenticalTo(1);
436 $fields = ['nom_adh', 'ville_adh', 'dynfield_' . $df->getId(), 'fingerprint'];
437 $file_name = 'test-import-atoum-dyn.csv';
439 'success_detected' => ["File '$file_name' has been successfully imported :)"]
441 $members_list = $this->getMemberData1();
442 foreach ($members_list as $fingerprint => &$data) {
443 $data['dynfield_' . $df->getId()] = 'Dynamic field value for ' . $data['fingerprint'];
448 $this->doImportFileTest($fields, $file_name, $flash_messages, $members_list, $count_before, $count_after);
451 //$fields does not change from previous
452 $file_name = 'test-import-atoum-dyn-noname.csv';
454 'error_detected' => [
455 'File does not comply with requirements.',
456 'Field nom_adh is required, but missing in row 3'
459 $members_list = $this->getMemberData2NoName();
460 foreach ($members_list as $fingerprint => &$data) {
461 $data['dynfield_' . $df->getId()] = 'Dynamic field value for ' . $data['fingerprint'];
467 $this->doImportFileTest($fields, $file_name, $flash_messages, $members_list, $count_before, $count_after);
469 //missing required dynamic field
470 //$fields does not change from previous
471 $file_name = 'test-import-atoum-dyn-nodyn.csv';
473 'error_detected' => [
474 'File does not comply with requirements.',
475 'Missing required field Dynamic text field'
478 $members_list = $this->getMemberData2();
480 foreach ($members_list as $fingerprint => &$data) {
481 //two lines without required dynamic field.
482 $data['dynfield_' . $df->getId()] = (($i == 2 ||
$i == 5) ?
'' :
483 'Dynamic field value for ' . $data['fingerprint']);
490 $this->doImportFileTest($fields, $file_name, $flash_messages, $members_list, $count_before, $count_after);
492 //cleanup members and dynamic fields values
493 $delete = $this->zdb
->delete(\Galette\Entity\Adherent
::TABLE
);
494 $this->zdb
->execute($delete);
495 $delete = $this->zdb
->delete(\Galette\Entity\DynamicFieldsHandle
::TABLE
);
496 $this->zdb
->execute($delete);
498 //new dynamic field, of type choice.
505 'form_name' => 'adh',
506 'field_name' => 'Dynamic choice field',
507 'field_perm' => DynamicField
::PERM_USER_WRITE
,
508 'field_type' => DynamicField
::CHOICE
,
509 'field_required' => 0,
511 'fixed_values' => implode("\n", $values)
514 $cdf = DynamicField
::getFieldType($this->zdb
, $cfield_data['field_type']);
516 $stored = $cdf->store($cfield_data);
517 $error_detected = $cdf->getErrors();
518 $warning_detected = $cdf->getWarnings();
519 $this->boolean($stored)->isTrue(
522 $cdf->getErrors() +
$cdf->getWarnings()
525 $this->array($error_detected)->isEmpty(implode(' ', $cdf->getErrors()));
526 $this->array($warning_detected)->isEmpty(implode(' ', $cdf->getWarnings()));
527 //check if dynamic translation has been added
528 $this->checkDynamicTranslation($cfield_data['field_name']);
530 $select = $this->zdb
->select(DynamicField
::TABLE
);
531 $select->columns(array('num' => new \Laminas\Db\Sql\
Expression('COUNT(1)')));
532 $result = $this->zdb
->execute($select)->current();
533 $this->integer((int)$result->num
)->isIdenticalTo(2);
535 $this->array($cdf->getValues())->isIdenticalTo($values);
537 $fields = ['nom_adh', 'ville_adh', 'dynfield_' . $cdf->getId(), 'fingerprint'];
538 $file_name = 'test-import-atoum-dyn-cdyn.csv';
540 'success_detected' => ["File '$file_name' has been successfully imported :)"]
542 $members_list = $this->getMemberData1();
543 foreach ($members_list as $fingerprint => &$data) {
544 //two lines without required dynamic field.
545 $data['dynfield_' . $cdf->getId()] = rand(0, 2);
551 $this->doImportFileTest(
561 //cleanup members and dynamic fields values
562 $delete = $this->zdb
->delete(\Galette\Entity\Adherent
::TABLE
);
563 $this->zdb
->execute($delete);
564 $delete = $this->zdb
->delete(\Galette\Entity\DynamicFieldsHandle
::TABLE
);
565 $this->zdb
->execute($delete);
566 //cleanup dynamic choices table
567 $this->contents_table
= $cdf->getFixedValuesTableName($cdf->getId());
569 //new dynamic field, of type date.
571 'form_name' => 'adh',
572 'field_name' => 'Dynamic date field',
573 'field_perm' => DynamicField
::PERM_USER_WRITE
,
574 'field_type' => DynamicField
::DATE
,
575 'field_required' => 0,
579 $cdf = DynamicField
::getFieldType($this->zdb
, $cfield_data['field_type']);
581 $stored = $cdf->store($cfield_data);
582 $error_detected = $cdf->getErrors();
583 $warning_detected = $cdf->getWarnings();
584 $this->boolean($stored)->isTrue(
587 $cdf->getErrors() +
$cdf->getWarnings()
590 $this->array($error_detected)->isEmpty(implode(' ', $cdf->getErrors()));
591 $this->array($warning_detected)->isEmpty(implode(' ', $cdf->getWarnings()));
592 //check if dynamic translation has been added
593 $this->checkDynamicTranslation($cfield_data['field_name']);
595 $select = $this->zdb
->select(DynamicField
::TABLE
);
596 $select->columns(array('num' => new \Laminas\Db\Sql\
Expression('COUNT(1)')));
597 $result = $this->zdb
->execute($select)->current();
598 $this->integer((int)$result->num
)->isIdenticalTo(3);
601 $fields = ['nom_adh', 'ville_adh', 'dynfield_' . $cdf->getId(), 'fingerprint'];
602 $file_name = 'test-import-atoum-cdyn-date.csv';
604 'success_detected' => ["File '$file_name' has been successfully imported :)"]
606 $members_list = $this->getMemberData1();
607 foreach ($members_list as $fingerprint => &$data) {
608 //two lines without required dynamic field.
609 $data['dynfield_' . $cdf->getId()] = $data['date_crea_adh'];
615 $this->doImportFileTest($fields, $file_name, $flash_messages, $members_list, $count_before, $count_after);
617 //Test with a bad date
618 //$fields does not change from previous
619 $file_name = 'test-import-atoum-cdyn-baddate.csv';
621 'error_detected' => [
622 'File does not comply with requirements.',
623 '- Wrong date format (Y-m-d) for Dynamic date field!'
626 $members_list = $this->getMemberData2();
628 foreach ($members_list as $fingerprint => &$data) {
629 //two lines without required dynamic field.
630 $data['dynfield_' . $cdf->getId()] = (($i == 2 ||
$i == 5) ?
'20200513' : $data['date_crea_adh']);
637 $this->doImportFileTest($fields, $file_name, $flash_messages, $members_list, $count_before, $count_after);
641 * Get first set of member data
645 private function getMemberData1()
649 'nom_adh' => 'Boucher',
650 'prenom_adh' => 'Roland',
651 'ville_adh' => 'Dumas',
653 'adresse_adh' => '5, chemin de Meunier',
654 'email_adh' => 'remy44@lopez.net',
655 'login_adh' => 'jean36',
656 'mdp_adh' => 'HM~OCSl[]UkZp%Y',
657 'mdp_adh2' => 'HM~OCSl[]UkZp%Y',
658 'bool_admin_adh' => false,
659 'bool_exempt_adh' => true,
660 'bool_display_info' => false,
662 'prof_adh' => 'Technicien géomètre',
664 'ddn_adh' => '1914-03-22',
665 'lieu_naissance' => 'Laurent-sur-Guyot',
666 'pseudo_adh' => 'tgonzalez',
668 'tel_adh' => '+33 8 93 53 99 52',
670 'activite_adh' => true,
672 'date_crea_adh' => '2020-03-09',
674 'fingerprint' => 'FAKER_0',
677 'nom_adh' => 'Lefebvre',
678 'prenom_adh' => 'François',
679 'ville_adh' => 'Laine',
681 'adresse_adh' => '311, rue de Costa',
682 'email_adh' => 'astrid64@masse.fr',
683 'login_adh' => 'olivier.pierre',
684 'mdp_adh' => '.4y/J>yN_QUh7Bw@NW>)',
685 'mdp_adh2' => '.4y/J>yN_QUh7Bw@NW>)',
686 'bool_admin_adh' => false,
687 'bool_exempt_adh' => false,
688 'bool_display_info' => false,
690 'prof_adh' => 'Conseiller relooking',
692 'ddn_adh' => '1989-10-31',
693 'lieu_naissance' => 'Collet',
694 'pseudo_adh' => 'agnes.evrard',
696 'tel_adh' => '0288284193',
697 'url_adh' => 'https://leroux.fr/omnis-autem-suscipit-consequuntur-possimus-sint-iste-beatae.html',
698 'activite_adh' => true,
700 'date_crea_adh' => '2019-11-29',
702 'fingerprint' => 'FAKER_1',
705 'nom_adh' => 'Lemaire',
706 'prenom_adh' => 'Georges',
707 'ville_adh' => 'Teixeira-sur-Mer',
709 'adresse_adh' => 'place Guillaume',
710 'email_adh' => 'lefort.vincent@club-internet.fr',
711 'login_adh' => 'josette46',
712 'mdp_adh' => '(IqBaAIR',
713 'mdp_adh2' => '(IqBaAIR',
714 'bool_admin_adh' => false,
715 'bool_exempt_adh' => false,
716 'bool_display_info' => true,
718 'prof_adh' => 'Assistant logistique',
720 'ddn_adh' => '1935-09-07',
721 'lieu_naissance' => 'Ponsboeuf',
722 'pseudo_adh' => 'fgay',
724 'tel_adh' => '+33 7 45 45 19 81',
726 'activite_adh' => true,
728 'date_crea_adh' => '2019-02-03',
730 'fingerprint' => 'FAKER_2',
734 'prenom_adh' => 'Thibaut',
735 'ville_adh' => 'Mallet-sur-Prevost',
737 'adresse_adh' => '246, boulevard Daniel Mendes',
738 'email_adh' => 'ihamel@pinto.fr',
739 'login_adh' => 'josephine.fabre',
740 'mdp_adh' => '`2LrQcb9Utgm=Y\\S$',
741 'mdp_adh2' => '`2LrQcb9Utgm=Y\\S$',
742 'bool_admin_adh' => false,
743 'bool_exempt_adh' => false,
744 'bool_display_info' => true,
746 'prof_adh' => 'Aide à domicile',
748 'ddn_adh' => '1961-09-17',
749 'lieu_naissance' => 'Gomez',
750 'pseudo_adh' => 'chauvin.guillaume',
751 'pays_adh' => 'Hong Kong',
752 'tel_adh' => '+33 5 48 57 32 28',
754 'activite_adh' => true,
756 'date_crea_adh' => '2017-11-20',
757 'pref_lang' => 'nb_NO',
758 'fingerprint' => 'FAKER_3',
759 'societe_adh' => 'Jacques',
760 'is_company' => true,
763 'nom_adh' => 'Pascal',
764 'prenom_adh' => 'Isaac',
765 'ville_adh' => 'Jourdanboeuf',
767 'adresse_adh' => '5, boulevard de Boucher',
768 'email_adh' => 'valerie.becker@gmail.com',
769 'login_adh' => 'lucie08',
770 'mdp_adh' => '|%+wtMW{l',
771 'mdp_adh2' => '|%+wtMW{l',
772 'bool_admin_adh' => false,
773 'bool_exempt_adh' => false,
774 'bool_display_info' => true,
776 'prof_adh' => 'Bruiteur',
778 'ddn_adh' => '1953-12-11',
779 'lieu_naissance' => 'Foucher',
780 'pseudo_adh' => 'sauvage.dorothee',
781 'pays_adh' => 'Bangladesh',
782 'tel_adh' => '+33 4 75 14 66 56',
784 'activite_adh' => false,
786 'date_crea_adh' => '2018-08-16',
787 'pref_lang' => 'en_US',
788 'fingerprint' => 'FAKER_4',
791 'nom_adh' => 'Morvan',
792 'prenom_adh' => 'Joseph',
793 'ville_adh' => 'Noel',
795 'adresse_adh' => 'place de Barthelemy',
796 'email_adh' => 'claunay@tele2.fr',
797 'login_adh' => 'marthe.hoarau',
798 'mdp_adh' => '\'C?}vJAU>:-iE',
799 'mdp_adh2' => '\'C?}vJAU>:-iE',
800 'bool_admin_adh' => false,
801 'bool_exempt_adh' => false,
802 'bool_display_info' => true,
804 'prof_adh' => 'Opérateur du son',
806 'ddn_adh' => '1938-05-11',
807 'lieu_naissance' => 'Beguedan',
808 'pseudo_adh' => 'andre.guillou',
810 'tel_adh' => '09 26 70 06 55',
811 'url_adh' => 'http://www.hoarau.fr/quis-neque-ducimus-quidem-et',
812 'activite_adh' => true,
814 'date_crea_adh' => '2018-09-28',
816 'fingerprint' => 'FAKER_5',
819 'nom_adh' => 'Lebreton',
820 'prenom_adh' => 'Emmanuelle',
821 'ville_adh' => 'Lefevre',
823 'adresse_adh' => '98, rue Moulin',
824 'email_adh' => 'zacharie77@ruiz.fr',
825 'login_adh' => 'marianne.collin',
826 'mdp_adh' => '=jG{wyE',
827 'mdp_adh2' => '=jG{wyE',
828 'bool_admin_adh' => false,
829 'bool_exempt_adh' => false,
830 'bool_display_info' => true,
832 'prof_adh' => 'Galeriste',
834 'ddn_adh' => '2001-02-01',
835 'lieu_naissance' => 'Berthelot',
836 'pseudo_adh' => 'ferreira.rene',
837 'pays_adh' => 'Tuvalu',
838 'tel_adh' => '+33 (0)7 47 56 89 70',
840 'activite_adh' => true,
842 'date_crea_adh' => '2018-01-13',
844 'fingerprint' => 'FAKER_6',
847 'nom_adh' => 'Maurice',
848 'prenom_adh' => 'Capucine',
849 'ville_adh' => 'Renaultdan',
850 'cp_adh' => '59 348',
851 'adresse_adh' => '56, avenue Grenier',
852 'email_adh' => 'didier.emmanuel@tiscali.fr',
853 'login_adh' => 'william.herve',
854 'mdp_adh' => '#7yUz#qToZ\'',
855 'mdp_adh2' => '#7yUz#qToZ\'',
856 'bool_admin_adh' => false,
857 'bool_exempt_adh' => false,
858 'bool_display_info' => true,
860 'prof_adh' => 'Cintrier-machiniste',
862 'ddn_adh' => '1984-04-17',
863 'lieu_naissance' => 'Rolland',
864 'pseudo_adh' => 'roger27',
865 'pays_adh' => 'Antilles néerlandaises',
866 'tel_adh' => '0922523762',
868 'activite_adh' => true,
870 'date_crea_adh' => '2020-02-13',
872 'fingerprint' => 'FAKER_7',
873 'societe_adh' => 'Mace',
874 'is_company' => true,
877 'nom_adh' => 'Hubert',
878 'prenom_adh' => 'Lucy',
879 'ville_adh' => 'Lagarde',
880 'cp_adh' => '22 829',
881 'adresse_adh' => '3, rue Pénélope Marie',
882 'email_adh' => 'zoe02@morvan.com',
883 'login_adh' => 'bernard.agathe',
884 'mdp_adh' => '@9di}eJyc"0s_d(',
885 'mdp_adh2' => '@9di}eJyc"0s_d(',
886 'bool_admin_adh' => false,
887 'bool_exempt_adh' => false,
888 'bool_display_info' => true,
890 'prof_adh' => 'Facteur',
892 'ddn_adh' => '2008-01-13',
893 'lieu_naissance' => 'Ribeiro',
894 'pseudo_adh' => 'julien.isabelle',
895 'pays_adh' => 'Mexique',
896 'tel_adh' => '0809527977',
898 'activite_adh' => true,
900 'date_crea_adh' => '2019-06-26',
901 'pref_lang' => 'de_DE',
902 'fingerprint' => 'FAKER_8',
905 'nom_adh' => 'Goncalves',
906 'prenom_adh' => 'Corinne',
907 'ville_adh' => 'LesageVille',
909 'adresse_adh' => '18, rue de Pinto',
910 'email_adh' => 'julien.clement@dbmail.com',
911 'login_adh' => 'xavier.nicolas',
912 'mdp_adh' => '<W0XdOj2Gp|@;W}gWh]',
913 'mdp_adh2' => '<W0XdOj2Gp|@;W}gWh]',
914 'bool_admin_adh' => false,
915 'bool_exempt_adh' => false,
916 'bool_display_info' => true,
918 'prof_adh' => 'Eleveur de volailles',
920 'ddn_adh' => '2013-09-12',
921 'lieu_naissance' => 'Breton',
922 'pseudo_adh' => 'louis.pruvost',
924 'tel_adh' => '+33 (0)6 80 24 46 58',
926 'activite_adh' => true,
928 'date_crea_adh' => '2020-08-09',
930 'fingerprint' => 'FAKER_9',
936 * Get second set of member data
937 * two lines without name.
941 private function getMemberData2()
945 'nom_adh' => 'Goncalves',
946 'prenom_adh' => 'Margot',
947 'ville_adh' => 'Alves',
949 'adresse_adh' => '43, impasse Maurice Imbert',
950 'email_adh' => 'guillou.richard@yahoo.fr',
951 'login_adh' => 'suzanne.mathieu',
952 'mdp_adh' => 'Thihk2z0',
953 'mdp_adh2' => 'Thihk2z0',
954 'bool_admin_adh' => false,
955 'bool_exempt_adh' => false,
956 'bool_display_info' => true,
958 'prof_adh' => 'Cueilleur de cerises',
960 'ddn_adh' => '2020-04-24',
961 'lieu_naissance' => 'Poulain-les-Bains',
962 'pseudo_adh' => 'olivier.roux',
963 'pays_adh' => 'République Dominicaine',
964 'tel_adh' => '08 95 04 73 14',
966 'activite_adh' => true,
968 'date_crea_adh' => '2020-07-31',
970 'fingerprint' => 'FAKER_0',
973 'nom_adh' => 'Da Silva',
974 'prenom_adh' => 'Augustin',
975 'ville_adh' => 'Perrin-sur-Masson',
977 'adresse_adh' => '154, place Boulay',
978 'email_adh' => 'marc60@moreno.fr',
979 'login_adh' => 'hoarau.maryse',
980 'mdp_adh' => '\\9Si%r/FAmz.HE4!{Q\\',
981 'mdp_adh2' => '\\9Si%r/FAmz.HE4!{Q\\',
982 'bool_admin_adh' => false,
983 'bool_exempt_adh' => false,
984 'bool_display_info' => true,
986 'prof_adh' => 'Séismologue',
988 'ddn_adh' => '1988-06-26',
989 'lieu_naissance' => 'Martel',
990 'pseudo_adh' => 'hchevalier',
991 'pays_adh' => 'Kiribati',
992 'tel_adh' => '04 55 49 80 92',
993 'url_adh' => 'http://www.leblanc.com/nemo-non-rerum-commodi-sequi-ut',
994 'activite_adh' => true,
996 'date_crea_adh' => '2020-06-02',
997 'pref_lang' => 'fr_FR',
998 'fingerprint' => 'FAKER_1',
1000 'FAKER_2' => array (
1002 'prenom_adh' => 'Laetitia',
1003 'ville_adh' => 'SimonBourg',
1004 'cp_adh' => '90351',
1005 'adresse_adh' => '147, chemin de Chauvet',
1006 'email_adh' => 'jean.joseph@pinto.fr',
1007 'login_adh' => 'marianne.bourgeois',
1008 'mdp_adh' => '[oT:"ExE',
1009 'mdp_adh2' => '[oT:"ExE',
1010 'bool_admin_adh' => false,
1011 'bool_exempt_adh' => false,
1012 'bool_display_info' => true,
1014 'prof_adh' => 'Porteur de hottes',
1015 'titre_adh' => null,
1016 'ddn_adh' => '2010-03-13',
1017 'lieu_naissance' => 'Gallet',
1018 'pseudo_adh' => 'abarre',
1019 'pays_adh' => 'Kirghizistan',
1020 'tel_adh' => '07 47 63 11 31',
1021 'url_adh' => 'https://www.jacques.com/fuga-voluptatem-tenetur-rem-possimus',
1022 'activite_adh' => true,
1024 'date_crea_adh' => '2020-10-28',
1025 'pref_lang' => 'ar',
1026 'fingerprint' => 'FAKER_2',
1028 'FAKER_3' => array (
1029 'nom_adh' => 'Cordier',
1030 'prenom_adh' => 'Olivier',
1031 'ville_adh' => 'Lacroixboeuf',
1032 'cp_adh' => '58 787',
1033 'adresse_adh' => '77, place Gilbert Perrier',
1034 'email_adh' => 'adelaide07@yahoo.fr',
1035 'login_adh' => 'riou.sebastien',
1036 'mdp_adh' => '%"OC/UniE46',
1037 'mdp_adh2' => '%"OC/UniE46',
1038 'bool_admin_adh' => false,
1039 'bool_exempt_adh' => false,
1040 'bool_display_info' => false,
1042 'prof_adh' => 'Oenologue',
1043 'titre_adh' => null,
1044 'ddn_adh' => '2010-10-08',
1045 'lieu_naissance' => 'Leger',
1046 'pseudo_adh' => 'frederique.bernier',
1048 'tel_adh' => '+33 2 50 03 01 12',
1050 'activite_adh' => true,
1052 'date_crea_adh' => '2020-08-14',
1053 'pref_lang' => 'ar',
1054 'fingerprint' => 'FAKER_3',
1056 'FAKER_4' => array (
1057 'nom_adh' => 'Robert',
1058 'prenom_adh' => 'Grégoire',
1059 'ville_adh' => 'Delannoy-sur-Mer',
1060 'cp_adh' => '41185',
1061 'adresse_adh' => '15, boulevard de Pierre',
1062 'email_adh' => 'normand.matthieu@orange.fr',
1063 'login_adh' => 'guilbert.louis',
1064 'mdp_adh' => 'y(,HodJF*j',
1065 'mdp_adh2' => 'y(,HodJF*j',
1066 'bool_admin_adh' => false,
1067 'bool_exempt_adh' => false,
1068 'bool_display_info' => true,
1070 'prof_adh' => 'Mannequin détail',
1071 'titre_adh' => null,
1072 'ddn_adh' => '1974-05-14',
1073 'lieu_naissance' => 'Barbe-sur-Laurent',
1074 'pseudo_adh' => 'stoussaint',
1075 'pays_adh' => 'Îles Mineures Éloignées des États-Unis',
1076 'tel_adh' => '+33 (0)1 30 50 01 54',
1077 'url_adh' => 'http://www.lemaitre.org/dolorum-recusandae-non-eum-non',
1078 'activite_adh' => true,
1080 'date_crea_adh' => '2018-12-05',
1081 'pref_lang' => 'it_IT',
1082 'fingerprint' => 'FAKER_4',
1083 'societe_adh' => 'Chretien Martineau S.A.',
1084 'is_company' => true,
1086 'FAKER_5' => array (
1088 'prenom_adh' => 'Charles',
1089 'ville_adh' => 'Charpentier-sur-Lebrun',
1090 'cp_adh' => '99129',
1091 'adresse_adh' => '817, chemin de Bonnin',
1092 'email_adh' => 'guillou.augustin@live.com',
1093 'login_adh' => 'dominique80',
1094 'mdp_adh' => '~g??E0HE$A>2"e*C7+Kw',
1095 'mdp_adh2' => '~g??E0HE$A>2"e*C7+Kw',
1096 'bool_admin_adh' => true,
1097 'bool_exempt_adh' => false,
1098 'bool_display_info' => true,
1100 'prof_adh' => 'Commandant de police',
1101 'titre_adh' => null,
1102 'ddn_adh' => '2007-03-26',
1103 'lieu_naissance' => 'Boutin',
1104 'pseudo_adh' => 'virginie.jacquet',
1106 'tel_adh' => '0393209420',
1108 'activite_adh' => true,
1110 'date_crea_adh' => '2018-02-17',
1111 'pref_lang' => 'fr_FR',
1112 'fingerprint' => 'FAKER_5',
1114 'FAKER_6' => array (
1115 'nom_adh' => 'Thierry',
1116 'prenom_adh' => 'Louis',
1117 'ville_adh' => 'Henry',
1118 'cp_adh' => '98 144',
1119 'adresse_adh' => '383, avenue Éléonore Bouchet',
1120 'email_adh' => 'bernard.elodie@orange.fr',
1121 'login_adh' => 'ubreton',
1122 'mdp_adh' => 'lTBT@,hsE`co?C2=',
1123 'mdp_adh2' => 'lTBT@,hsE`co?C2=',
1124 'bool_admin_adh' => false,
1125 'bool_exempt_adh' => false,
1126 'bool_display_info' => false,
1128 'prof_adh' => 'Endocrinologue',
1129 'titre_adh' => null,
1130 'ddn_adh' => '1994-07-19',
1131 'lieu_naissance' => 'Pagesdan',
1132 'pseudo_adh' => 'diallo.sebastien',
1134 'tel_adh' => '+33 5 72 28 24 81',
1136 'activite_adh' => true,
1138 'date_crea_adh' => '2020-03-16',
1139 'pref_lang' => 'en_US',
1140 'fingerprint' => 'FAKER_6',
1142 'FAKER_7' => array (
1143 'nom_adh' => 'Delattre',
1144 'prenom_adh' => 'Susanne',
1145 'ville_adh' => 'Roche-les-Bains',
1146 'cp_adh' => '37 104',
1147 'adresse_adh' => '44, rue Suzanne Guilbert',
1148 'email_adh' => 'tmartel@wanadoo.fr',
1149 'login_adh' => 'lebreton.alexandre',
1150 'mdp_adh' => '{(3mCWC7[YL]n',
1151 'mdp_adh2' => '{(3mCWC7[YL]n',
1152 'bool_admin_adh' => false,
1153 'bool_exempt_adh' => false,
1154 'bool_display_info' => true,
1156 'prof_adh' => 'Gérant d\'hôtel',
1157 'titre_adh' => null,
1158 'ddn_adh' => '1914-05-16',
1159 'lieu_naissance' => 'Traore',
1160 'pseudo_adh' => 'helene59',
1162 'tel_adh' => '0383453389',
1163 'url_adh' => 'http://www.lesage.com/et-aperiam-labore-est-libero-voluptatem.html',
1164 'activite_adh' => true,
1166 'date_crea_adh' => '2020-02-03',
1167 'pref_lang' => 'oc',
1168 'fingerprint' => 'FAKER_7',
1170 'FAKER_8' => array (
1171 'nom_adh' => 'Peltier',
1172 'prenom_adh' => 'Inès',
1173 'ville_adh' => 'Thierry-sur-Carre',
1174 'cp_adh' => '80690',
1175 'adresse_adh' => '43, impasse Texier',
1176 'email_adh' => 'qdubois@mendes.fr',
1177 'login_adh' => 'julie.carlier',
1178 'mdp_adh' => '.ATai-E6%LIxE{',
1179 'mdp_adh2' => '.ATai-E6%LIxE{',
1180 'bool_admin_adh' => false,
1181 'bool_exempt_adh' => false,
1182 'bool_display_info' => true,
1184 'prof_adh' => 'Gynécologue',
1185 'titre_adh' => null,
1186 'ddn_adh' => '1988-05-29',
1187 'lieu_naissance' => 'Dijoux-sur-Michaud',
1188 'pseudo_adh' => 'wpierre',
1190 'tel_adh' => '01 32 14 47 74',
1192 'activite_adh' => true,
1194 'date_crea_adh' => '2020-03-28',
1195 'pref_lang' => 'ar',
1196 'fingerprint' => 'FAKER_8',
1198 'FAKER_9' => array (
1199 'nom_adh' => 'Marchand',
1200 'prenom_adh' => 'Audrey',
1201 'ville_adh' => 'Lenoirdan',
1202 'cp_adh' => '06494',
1203 'adresse_adh' => '438, place de Carre',
1204 'email_adh' => 'luc42@yahoo.fr',
1205 'login_adh' => 'margot.bousquet',
1206 'mdp_adh' => 'FH,q5udclwM(',
1207 'mdp_adh2' => 'FH,q5udclwM(',
1208 'bool_admin_adh' => false,
1209 'bool_exempt_adh' => false,
1210 'bool_display_info' => true,
1212 'prof_adh' => 'Convoyeur garde',
1213 'titre_adh' => null,
1214 'ddn_adh' => '1977-09-02',
1215 'lieu_naissance' => 'Arnaud-sur-Antoine',
1216 'pseudo_adh' => 'gerard66',
1218 'tel_adh' => '+33 1 46 04 81 87',
1219 'url_adh' => 'http://www.thierry.com/',
1220 'activite_adh' => true,
1222 'date_crea_adh' => '2019-05-16',
1223 'pref_lang' => 'fr_FR',
1224 'fingerprint' => 'FAKER_9',
1230 * Get second set of member data but two lines without name.
1234 private function getMemberData2NoName()
1236 $data = $this->getMemberData2();
1237 $data['FAKER_2']['nom_adh'] = '';
1238 $data['FAKER_5']['nom_adh'] = '';