4 * Copyright © 2003-2024 The Galette Team
6 * This file is part of Galette (https://galette.eu).
8 * Galette is free software: you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation, either version 3 of the License, or
11 * (at your option) any later version.
13 * Galette is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
18 * You should have received a copy of the GNU General Public License
19 * along with Galette. If not, see <http://www.gnu.org/licenses/>.
22 namespace Galette\IO\test\units
;
24 use Galette\Entity\FieldsConfig
;
25 use PHPUnit\Framework\TestCase
;
26 use Galette\Entity\Adherent
;
27 use Galette\DynamicFields\DynamicField
;
28 use Galette\GaletteTestCase
;
33 * @author Johan Cwiklinski <johan@x-tnd.be>
35 class CsvIn
extends GaletteTestCase
37 private ?
string $contents_table = null;
44 public function setUp(): void
47 $this->contents_table
= null;
55 public function tearDown(): void
59 $delete = $this->zdb
->delete(\Galette\Entity\Adherent
::TABLE
);
60 $this->zdb
->execute($delete);
61 $delete = $this->zdb
->delete(\Galette\Entity\DynamicFieldsHandle
::TABLE
);
62 $this->zdb
->execute($delete);
63 $delete = $this->zdb
->delete(DynamicField
::TABLE
);
64 $this->zdb
->execute($delete);
65 //cleanup dynamic translations
66 $delete = $this->zdb
->delete(\Galette\Core\L10n
::TABLE
);
69 'Dynamic choice field',
74 $this->zdb
->execute($delete);
76 if ($this->contents_table
!== null) {
77 $this->zdb
->drop($this->contents_table
);
82 * Import text CSV file
84 * @param array $fields Fields name to use at import
85 * @param string $file_name File name
86 * @param array $flash_messages Expected flash messages from doImport route
87 * @param array $members_list List of faked members data
88 * @param integer $count_before Count before insertions. Defaults to 0 if null.
89 * @param integer $count_after Count after insertions. Default to $count_before + count $members_list
90 * @param array $values Textual values for dynamic choices fields
94 private function doImportFileTest(
97 array $flash_messages,
103 if ($count_before === null) {
106 if ($count_after === null) {
107 $count_after = $count_before +
count($members_list);
110 $members = new \Galette\Repository\
Members();
111 $list = $members->getList();
115 print_r(debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS
, 1), true)
118 $model = $this->getModel($fields);
120 //get csv model file to add data in
121 $controller = new \Galette\Controllers\
CsvController($this->container
);
123 $rfactory = new \Slim\Psr7\Factory\
RequestFactory();
124 $request = $rfactory->createRequest('GET', 'http://localhost/models/csv');
125 $response = new \Slim\Psr7\
Response();
127 $response = $controller->getImportModel($request, $response);
128 $csvin = new \Galette\IO\
CsvIn($this->container
->get('zdb'));
130 $this->assertSame(200, $response->getStatusCode());
131 $headers = $response->getHeaders();
132 $this->assertIsArray($headers);
133 $this->assertSame(['text/csv'], $headers['Content-Type']);
135 ['attachment;filename="galette_import_model.csv"'],
136 $headers['Content-Disposition']
139 $csvfile_model = $response->getBody()->__toString();
141 "\"" . implode("\";\"", $fields) . "\"\r\n",
145 $contents = $csvfile_model;
146 foreach ($members_list as $member) {
148 foreach ($fields as $field) {
149 $amember[$field] = $member[$field];
151 $contents .= "\"" . implode("\";\"", $amember) . "\"\r\n";
154 $path = GALETTE_CACHE_DIR
. $file_name;
155 $this->assertIsInt(file_put_contents($path, $contents));
156 $_FILES['new_file'] = [
157 'error' => UPLOAD_ERR_OK
,
158 'name' => $file_name,
160 'size' => filesize($path)
162 $this->assertTrue($csvin->store($_FILES['new_file'], true));
163 $this->assertTrue(file_exists($csvin->getDestDir() . $csvin->getFileName()));
166 'import_file' => $file_name
169 $request = clone $request;
170 $request = $request->withParsedBody($post);
172 $response = $controller->doImports($request, $response);
173 $this->assertSame(301, $response->getStatusCode());
174 $this->assertSame($flash_messages, $this->flash_data
['slimFlash']);
175 $this->flash
->clearMessages();
177 $members = new \Galette\Repository\
Members();
178 $list = $members->getList();
179 $this->assertSame($count_after, $list->count());
181 if ($count_before != $count_after) {
182 foreach ($list as $member) {
183 $created = $members_list[$member->fingerprint
];
184 foreach ($fields as $field) {
185 if (property_exists($member, $field)) {
186 $this->assertEquals($created[$field], $member->$field);
188 //manage dynamic fields
190 if (preg_match('/^dynfield_(\d+)/', $field, $matches)) {
191 $adh = new Adherent($this->zdb
, (int)$member->id_adh
, ['dynamics' => true]);
194 'item_id' => $adh->id
,
195 'field_form' => 'adh',
197 'field_val' => $created[$field]
201 $dfield = $adh->getDynamicFields()->getValues($matches[1]);
202 if (isset($dfield[0]['text_val'])) {
203 //choice, add textual value
204 $expected[0]['text_val'] = $values[$created[$field]];
209 $adh->getDynamicFields()->getValues($matches[1])
212 throw new \
RuntimeException("Unknown field $field");
221 * Test CSV import loading
225 public function testImport()
227 $fields = ['nom_adh', 'ville_adh', 'bool_exempt_adh', 'fingerprint'];
228 $file_name = 'test-import-atoum.csv';
230 'success_detected' => ["File '$file_name' has been successfully imported :)"]
232 $members_list = $this->getMemberData1();
236 $this->doImportFileTest($fields, $file_name, $flash_messages, $members_list, $count_before, $count_after);
239 $file_name = 'test-import-atoum-noname.csv';
241 'error_detected' => [
242 'File does not comply with requirements.',
243 'Field nom_adh is required, but missing in row 3'
247 $members_list = $this->getMemberData2NoName();
251 $this->doImportFileTest($fields, $file_name, $flash_messages, $members_list, $count_before, $count_after);
255 * Get CSV import model
257 * @param array $fields Fields list
259 * @return \Galette\Entity\ImportModel
261 protected function getModel($fields): \Galette\Entity\ImportModel
263 $model = new \Galette\Entity\
ImportModel();
264 $this->assertTrue($model->remove($this->zdb
));
266 $this->assertInstanceOf(\Galette\Entity\ImportModel
::class, $model->setFields($fields));
267 $this->assertTrue($model->store($this->zdb
));
268 $this->assertTrue($model->load());
273 * Test dynamic translation has been added properly
275 * @param string $text_orig Original text
276 * @param string $lang Lang text has been added in
280 protected function checkDynamicTranslation($text_orig, $lang = 'fr_FR.utf8')
282 $langs = array_keys($this->i18n
->getArrayList());
283 $select = $this->zdb
->select(\Galette\Core\L10n
::TABLE
);
289 $select->where(['text_orig' => $text_orig]);
290 $results = $this->zdb
->execute($select);
291 $this->assertSame(count($langs), $results->count());
293 foreach ($results as $result) {
294 $this->assertTrue(in_array(str_replace('.utf8', '', $result['text_locale']), $langs));
295 $this->assertSame(1, (int)$result['text_nref']);
297 ($result['text_locale'] == 'en_US' ?
$text_orig : ''),
298 $result['text_trans']
304 * Test import with dynamic fields
308 public function testImportDynamics()
312 'form_name' => 'adh',
313 'field_name' => 'Dynamic text field',
314 'field_perm' => FieldsConfig
::USER_WRITE
,
315 'field_type' => DynamicField
::TEXT
,
316 'field_required' => 1,
320 $df = DynamicField
::getFieldType($this->zdb
, $field_data['field_type']);
322 $stored = $df->store($field_data);
323 $error_detected = $df->getErrors();
324 $warning_detected = $df->getWarnings();
329 $df->getErrors() +
$df->getWarnings()
332 $this->assertEmpty($error_detected, implode(' ', $df->getErrors()));
333 $this->assertEmpty($warning_detected, implode(' ', $df->getWarnings()));
334 //check if dynamic translation has been added
335 $this->checkDynamicTranslation($field_data['field_name']);
337 $select = $this->zdb
->select(DynamicField
::TABLE
);
338 $select->columns(array('num' => new \Laminas\Db\Sql\
Expression('COUNT(1)')));
339 $result = $this->zdb
->execute($select)->current();
340 $this->assertSame(1, (int)$result->num
);
342 $fields = ['nom_adh', 'ville_adh', 'dynfield_' . $df->getId(), 'fingerprint'];
343 $file_name = 'test-import-atoum-dyn.csv';
345 'success_detected' => ["File '$file_name' has been successfully imported :)"]
347 $members_list = $this->getMemberData1();
348 foreach ($members_list as $fingerprint => &$data) {
349 $data['dynfield_' . $df->getId()] = 'Dynamic field value for ' . $data['fingerprint'];
354 $this->doImportFileTest($fields, $file_name, $flash_messages, $members_list, $count_before, $count_after);
357 //$fields does not change from previous
358 $file_name = 'test-import-atoum-dyn-noname.csv';
360 'error_detected' => [
361 'File does not comply with requirements.',
362 'Field nom_adh is required, but missing in row 3'
365 $members_list = $this->getMemberData2NoName();
366 foreach ($members_list as $fingerprint => &$data) {
367 $data['dynfield_' . $df->getId()] = 'Dynamic field value for ' . $data['fingerprint'];
373 $this->doImportFileTest($fields, $file_name, $flash_messages, $members_list, $count_before, $count_after);
375 //missing required dynamic field
376 //$fields does not change from previous
377 $file_name = 'test-import-atoum-dyn-nodyn.csv';
379 'error_detected' => [
380 'File does not comply with requirements.',
381 'Missing required field Dynamic text field'
384 $members_list = $this->getMemberData2();
386 foreach ($members_list as $fingerprint => &$data) {
387 //two lines without required dynamic field.
388 $data['dynfield_' . $df->getId()] = (($i == 2 ||
$i == 5) ?
'' :
389 'Dynamic field value for ' . $data['fingerprint']);
396 $this->doImportFileTest($fields, $file_name, $flash_messages, $members_list, $count_before, $count_after);
398 //cleanup members and dynamic fields values
399 $delete = $this->zdb
->delete(\Galette\Entity\Adherent
::TABLE
);
400 $this->zdb
->execute($delete);
401 $delete = $this->zdb
->delete(\Galette\Entity\DynamicFieldsHandle
::TABLE
);
402 $this->zdb
->execute($delete);
404 //new dynamic field, of type choice.
411 'form_name' => 'adh',
412 'field_name' => 'Dynamic choice field',
413 'field_perm' => FieldsConfig
::USER_WRITE
,
414 'field_type' => DynamicField
::CHOICE
,
415 'field_required' => 0,
417 'fixed_values' => implode("\n", $values)
420 $cdf = DynamicField
::getFieldType($this->zdb
, $cfield_data['field_type']);
422 $stored = $cdf->store($cfield_data);
423 $error_detected = $cdf->getErrors();
424 $warning_detected = $cdf->getWarnings();
429 $cdf->getErrors() +
$cdf->getWarnings()
432 $this->assertEmpty($error_detected, implode(' ', $cdf->getErrors()));
433 $this->assertEmpty($warning_detected, implode(' ', $cdf->getWarnings()));
434 //check if dynamic translation has been added
435 $this->checkDynamicTranslation($cfield_data['field_name']);
437 $select = $this->zdb
->select(DynamicField
::TABLE
);
438 $select->columns(array('num' => new \Laminas\Db\Sql\
Expression('COUNT(1)')));
439 $result = $this->zdb
->execute($select)->current();
440 $this->assertSame(2, (int)$result->num
);
442 $this->assertSame($values, $cdf->getValues());
444 $fields = ['nom_adh', 'ville_adh', 'dynfield_' . $cdf->getId(), 'fingerprint'];
445 $file_name = 'test-import-atoum-dyn-cdyn.csv';
447 'success_detected' => ["File '$file_name' has been successfully imported :)"]
449 $members_list = $this->getMemberData1();
450 foreach ($members_list as $fingerprint => &$data) {
451 //two lines without required dynamic field.
452 $data['dynfield_' . $cdf->getId()] = rand(0, 2);
458 $this->doImportFileTest(
468 //cleanup members and dynamic fields values
469 $delete = $this->zdb
->delete(\Galette\Entity\Adherent
::TABLE
);
470 $this->zdb
->execute($delete);
471 $delete = $this->zdb
->delete(\Galette\Entity\DynamicFieldsHandle
::TABLE
);
472 $this->zdb
->execute($delete);
473 //cleanup dynamic choices table
474 $this->contents_table
= $cdf->getFixedValuesTableName($cdf->getId());
476 //new dynamic field, of type date.
478 'form_name' => 'adh',
479 'field_name' => 'Dynamic date field',
480 'field_perm' => FieldsConfig
::USER_WRITE
,
481 'field_type' => DynamicField
::DATE
,
482 'field_required' => 0,
486 $cdf = DynamicField
::getFieldType($this->zdb
, $cfield_data['field_type']);
488 $stored = $cdf->store($cfield_data);
489 $error_detected = $cdf->getErrors();
490 $warning_detected = $cdf->getWarnings();
495 $cdf->getErrors() +
$cdf->getWarnings()
498 $this->assertEmpty($error_detected, implode(' ', $cdf->getErrors()));
499 $this->assertEmpty($warning_detected, implode(' ', $cdf->getWarnings()));
500 //check if dynamic translation has been added
501 $this->checkDynamicTranslation($cfield_data['field_name']);
503 $select = $this->zdb
->select(DynamicField
::TABLE
);
504 $select->columns(array('num' => new \Laminas\Db\Sql\
Expression('COUNT(1)')));
505 $result = $this->zdb
->execute($select)->current();
506 $this->assertSame(3, (int)$result->num
);
509 $fields = ['nom_adh', 'ville_adh', 'dynfield_' . $cdf->getId(), 'fingerprint'];
510 $file_name = 'test-import-atoum-cdyn-date.csv';
512 'success_detected' => ["File '$file_name' has been successfully imported :)"]
514 $members_list = $this->getMemberData1();
515 foreach ($members_list as $fingerprint => &$data) {
516 //two lines without required dynamic field.
517 $data['dynfield_' . $cdf->getId()] = $data['date_crea_adh'];
523 $this->doImportFileTest($fields, $file_name, $flash_messages, $members_list, $count_before, $count_after);
525 //Test with a bad date
526 //$fields does not change from previous
527 $file_name = 'test-import-atoum-cdyn-baddate.csv';
529 'error_detected' => [
530 'File does not comply with requirements.',
531 '- Wrong date format (Y-m-d) for Dynamic date field!'
534 $members_list = $this->getMemberData2();
536 foreach ($members_list as $fingerprint => &$data) {
537 //two lines without required dynamic field.
538 $data['dynfield_' . $cdf->getId()] = (($i == 2 ||
$i == 5) ?
'20200513' : $data['date_crea_adh']);
545 $this->doImportFileTest($fields, $file_name, $flash_messages, $members_list, $count_before, $count_after);
549 * Get first set of member data
553 private function getMemberData1()
557 'nom_adh' => 'Boucher',
558 'prenom_adh' => 'Roland',
559 'ville_adh' => 'Dumas',
561 'adresse_adh' => '5, chemin de Meunier',
562 'email_adh' => 'remy44@lopez.net',
563 'login_adh' => 'jean36',
564 'mdp_adh' => 'HM~OCSl[]UkZp%Y',
565 'mdp_adh2' => 'HM~OCSl[]UkZp%Y',
566 'bool_admin_adh' => false,
567 'bool_exempt_adh' => true,
568 'bool_display_info' => false,
570 'prof_adh' => 'Technicien géomètre',
572 'ddn_adh' => '1914-03-22',
573 'lieu_naissance' => 'Laurent-sur-Guyot',
574 'pseudo_adh' => 'tgonzalez',
576 'tel_adh' => '+33 8 93 53 99 52',
577 'activite_adh' => true,
579 'date_crea_adh' => '2020-03-09',
581 'fingerprint' => 'FAKER_0',
584 'nom_adh' => 'Lefebvre',
585 'prenom_adh' => 'François',
586 'ville_adh' => 'Laine',
588 'adresse_adh' => '311, rue de Costa',
589 'email_adh' => 'astrid64@masse.fr',
590 'login_adh' => 'olivier.pierre',
591 'mdp_adh' => '.4y/J>yN_QUh7Bw@NW>)',
592 'mdp_adh2' => '.4y/J>yN_QUh7Bw@NW>)',
593 'bool_admin_adh' => false,
594 'bool_exempt_adh' => false,
595 'bool_display_info' => false,
597 'prof_adh' => 'Conseiller relooking',
599 'ddn_adh' => '1989-10-31',
600 'lieu_naissance' => 'Collet',
601 'pseudo_adh' => 'agnes.evrard',
603 'tel_adh' => '0288284193',
604 'activite_adh' => true,
606 'date_crea_adh' => '2019-11-29',
608 'fingerprint' => 'FAKER_1',
611 'nom_adh' => 'Lemaire',
612 'prenom_adh' => 'Georges',
613 'ville_adh' => 'Teixeira-sur-Mer',
615 'adresse_adh' => 'place Guillaume',
616 'email_adh' => 'lefort.vincent@club-internet.fr',
617 'login_adh' => 'josette46',
618 'mdp_adh' => '(IqBaAIR',
619 'mdp_adh2' => '(IqBaAIR',
620 'bool_admin_adh' => false,
621 'bool_exempt_adh' => false,
622 'bool_display_info' => true,
624 'prof_adh' => 'Assistant logistique',
626 'ddn_adh' => '1935-09-07',
627 'lieu_naissance' => 'Ponsboeuf',
628 'pseudo_adh' => 'fgay',
630 'tel_adh' => '+33 7 45 45 19 81',
631 'activite_adh' => true,
633 'date_crea_adh' => '2019-02-03',
635 'fingerprint' => 'FAKER_2',
639 'prenom_adh' => 'Thibaut',
640 'ville_adh' => 'Mallet-sur-Prevost',
642 'adresse_adh' => '246, boulevard Daniel Mendes',
643 'email_adh' => 'ihamel@pinto.fr',
644 'login_adh' => 'josephine.fabre',
645 'mdp_adh' => '`2LrQcb9Utgm=Y\\S$',
646 'mdp_adh2' => '`2LrQcb9Utgm=Y\\S$',
647 'bool_admin_adh' => false,
648 'bool_exempt_adh' => false,
649 'bool_display_info' => true,
651 'prof_adh' => 'Aide à domicile',
653 'ddn_adh' => '1961-09-17',
654 'lieu_naissance' => 'Gomez',
655 'pseudo_adh' => 'chauvin.guillaume',
656 'pays_adh' => 'Hong Kong',
657 'tel_adh' => '+33 5 48 57 32 28',
658 'activite_adh' => true,
660 'date_crea_adh' => '2017-11-20',
661 'pref_lang' => 'nb_NO',
662 'fingerprint' => 'FAKER_3',
663 'societe_adh' => 'Jacques',
664 'is_company' => true,
667 'nom_adh' => 'Pascal',
668 'prenom_adh' => 'Isaac',
669 'ville_adh' => 'Jourdanboeuf',
671 'adresse_adh' => '5, boulevard de Boucher',
672 'email_adh' => 'valerie.becker@gmail.com',
673 'login_adh' => 'lucie08',
674 'mdp_adh' => '|%+wtMW{l',
675 'mdp_adh2' => '|%+wtMW{l',
676 'bool_admin_adh' => false,
677 'bool_exempt_adh' => false,
678 'bool_display_info' => true,
680 'prof_adh' => 'Bruiteur',
682 'ddn_adh' => '1953-12-11',
683 'lieu_naissance' => 'Foucher',
684 'pseudo_adh' => 'sauvage.dorothee',
685 'pays_adh' => 'Bangladesh',
686 'tel_adh' => '+33 4 75 14 66 56',
687 'activite_adh' => false,
689 'date_crea_adh' => '2018-08-16',
690 'pref_lang' => 'en_US',
691 'fingerprint' => 'FAKER_4',
694 'nom_adh' => 'Morvan',
695 'prenom_adh' => 'Joseph',
696 'ville_adh' => 'Noel',
698 'adresse_adh' => 'place de Barthelemy',
699 'email_adh' => 'claunay@tele2.fr',
700 'login_adh' => 'marthe.hoarau',
701 'mdp_adh' => '\'C?}vJAU>:-iE',
702 'mdp_adh2' => '\'C?}vJAU>:-iE',
703 'bool_admin_adh' => false,
704 'bool_exempt_adh' => false,
705 'bool_display_info' => true,
707 'prof_adh' => 'Opérateur du son',
709 'ddn_adh' => '1938-05-11',
710 'lieu_naissance' => 'Beguedan',
711 'pseudo_adh' => 'andre.guillou',
713 'tel_adh' => '09 26 70 06 55',
714 'activite_adh' => true,
716 'date_crea_adh' => '2018-09-28',
718 'fingerprint' => 'FAKER_5',
721 'nom_adh' => 'Lebreton',
722 'prenom_adh' => 'Emmanuelle',
723 'ville_adh' => 'Lefevre',
725 'adresse_adh' => '98, rue Moulin',
726 'email_adh' => 'zacharie77@ruiz.fr',
727 'login_adh' => 'marianne.collin',
728 'mdp_adh' => '=jG{wyE',
729 'mdp_adh2' => '=jG{wyE',
730 'bool_admin_adh' => false,
731 'bool_exempt_adh' => false,
732 'bool_display_info' => true,
734 'prof_adh' => 'Galeriste',
736 'ddn_adh' => '2001-02-01',
737 'lieu_naissance' => 'Berthelot',
738 'pseudo_adh' => 'ferreira.rene',
739 'pays_adh' => 'Tuvalu',
740 'tel_adh' => '+33 (0)7 47 56 89 70',
741 'activite_adh' => true,
743 'date_crea_adh' => '2018-01-13',
745 'fingerprint' => 'FAKER_6',
748 'nom_adh' => 'Maurice',
749 'prenom_adh' => 'Capucine',
750 'ville_adh' => 'Renaultdan',
751 'cp_adh' => '59 348',
752 'adresse_adh' => '56, avenue Grenier',
753 'email_adh' => 'didier.emmanuel@tiscali.fr',
754 'login_adh' => 'william.herve',
755 'mdp_adh' => '#7yUz#qToZ\'',
756 'mdp_adh2' => '#7yUz#qToZ\'',
757 'bool_admin_adh' => false,
758 'bool_exempt_adh' => false,
759 'bool_display_info' => true,
761 'prof_adh' => 'Cintrier-machiniste',
763 'ddn_adh' => '1984-04-17',
764 'lieu_naissance' => 'Rolland',
765 'pseudo_adh' => 'roger27',
766 'pays_adh' => 'Antilles néerlandaises',
767 'tel_adh' => '0922523762',
768 'activite_adh' => true,
770 'date_crea_adh' => '2020-02-13',
772 'fingerprint' => 'FAKER_7',
773 'societe_adh' => 'Mace',
774 'is_company' => true,
777 'nom_adh' => 'Hubert',
778 'prenom_adh' => 'Lucy',
779 'ville_adh' => 'Lagarde',
780 'cp_adh' => '22 829',
781 'adresse_adh' => '3, rue Pénélope Marie',
782 'email_adh' => 'zoe02@morvan.com',
783 'login_adh' => 'bernard.agathe',
784 'mdp_adh' => '@9di}eJyc"0s_d(',
785 'mdp_adh2' => '@9di}eJyc"0s_d(',
786 'bool_admin_adh' => false,
787 'bool_exempt_adh' => false,
788 'bool_display_info' => true,
790 'prof_adh' => 'Facteur',
792 'ddn_adh' => '2008-01-13',
793 'lieu_naissance' => 'Ribeiro',
794 'pseudo_adh' => 'julien.isabelle',
795 'pays_adh' => 'Mexique',
796 'tel_adh' => '0809527977',
797 'activite_adh' => true,
799 'date_crea_adh' => '2019-06-26',
800 'pref_lang' => 'de_DE',
801 'fingerprint' => 'FAKER_8',
804 'nom_adh' => 'Goncalves',
805 'prenom_adh' => 'Corinne',
806 'ville_adh' => 'LesageVille',
808 'adresse_adh' => '18, rue de Pinto',
809 'email_adh' => 'julien.clement@dbmail.com',
810 'login_adh' => 'xavier.nicolas',
811 'mdp_adh' => '<W0XdOj2Gp|@;W}gWh]',
812 'mdp_adh2' => '<W0XdOj2Gp|@;W}gWh]',
813 'bool_admin_adh' => false,
814 'bool_exempt_adh' => false,
815 'bool_display_info' => true,
817 'prof_adh' => 'Eleveur de volailles',
819 'ddn_adh' => '2013-09-12',
820 'lieu_naissance' => 'Breton',
821 'pseudo_adh' => 'louis.pruvost',
823 'tel_adh' => '+33 (0)6 80 24 46 58',
824 'activite_adh' => true,
826 'date_crea_adh' => '2020-08-09',
828 'fingerprint' => 'FAKER_9',
834 * Get second set of member data
835 * two lines without name.
839 private function getMemberData2()
843 'nom_adh' => 'Goncalves',
844 'prenom_adh' => 'Margot',
845 'ville_adh' => 'Alves',
847 'adresse_adh' => '43, impasse Maurice Imbert',
848 'email_adh' => 'guillou.richard@yahoo.fr',
849 'login_adh' => 'suzanne.mathieu',
850 'mdp_adh' => 'Thihk2z0',
851 'mdp_adh2' => 'Thihk2z0',
852 'bool_admin_adh' => false,
853 'bool_exempt_adh' => false,
854 'bool_display_info' => true,
856 'prof_adh' => 'Cueilleur de cerises',
858 'ddn_adh' => '2020-04-24',
859 'lieu_naissance' => 'Poulain-les-Bains',
860 'pseudo_adh' => 'olivier.roux',
861 'pays_adh' => 'République Dominicaine',
862 'tel_adh' => '08 95 04 73 14',
863 'activite_adh' => true,
865 'date_crea_adh' => '2020-07-31',
867 'fingerprint' => 'FAKER_0',
870 'nom_adh' => 'Da Silva',
871 'prenom_adh' => 'Augustin',
872 'ville_adh' => 'Perrin-sur-Masson',
874 'adresse_adh' => '154, place Boulay',
875 'email_adh' => 'marc60@moreno.fr',
876 'login_adh' => 'hoarau.maryse',
877 'mdp_adh' => '\\9Si%r/FAmz.HE4!{Q\\',
878 'mdp_adh2' => '\\9Si%r/FAmz.HE4!{Q\\',
879 'bool_admin_adh' => false,
880 'bool_exempt_adh' => false,
881 'bool_display_info' => true,
883 'prof_adh' => 'Séismologue',
885 'ddn_adh' => '1988-06-26',
886 'lieu_naissance' => 'Martel',
887 'pseudo_adh' => 'hchevalier',
888 'pays_adh' => 'Kiribati',
889 'tel_adh' => '04 55 49 80 92',
890 'activite_adh' => true,
892 'date_crea_adh' => '2020-06-02',
893 'pref_lang' => 'fr_FR',
894 'fingerprint' => 'FAKER_1',
898 'prenom_adh' => 'Laetitia',
899 'ville_adh' => 'SimonBourg',
901 'adresse_adh' => '147, chemin de Chauvet',
902 'email_adh' => 'jean.joseph@pinto.fr',
903 'login_adh' => 'marianne.bourgeois',
904 'mdp_adh' => '[oT:"ExE',
905 'mdp_adh2' => '[oT:"ExE',
906 'bool_admin_adh' => false,
907 'bool_exempt_adh' => false,
908 'bool_display_info' => true,
910 'prof_adh' => 'Porteur de hottes',
912 'ddn_adh' => '2010-03-13',
913 'lieu_naissance' => 'Gallet',
914 'pseudo_adh' => 'abarre',
915 'pays_adh' => 'Kirghizistan',
916 'tel_adh' => '07 47 63 11 31',
917 'activite_adh' => true,
919 'date_crea_adh' => '2020-10-28',
921 'fingerprint' => 'FAKER_2',
924 'nom_adh' => 'Cordier',
925 'prenom_adh' => 'Olivier',
926 'ville_adh' => 'Lacroixboeuf',
927 'cp_adh' => '58 787',
928 'adresse_adh' => '77, place Gilbert Perrier',
929 'email_adh' => 'adelaide07@yahoo.fr',
930 'login_adh' => 'riou.sebastien',
931 'mdp_adh' => '%"OC/UniE46',
932 'mdp_adh2' => '%"OC/UniE46',
933 'bool_admin_adh' => false,
934 'bool_exempt_adh' => false,
935 'bool_display_info' => false,
937 'prof_adh' => 'Oenologue',
939 'ddn_adh' => '2010-10-08',
940 'lieu_naissance' => 'Leger',
941 'pseudo_adh' => 'frederique.bernier',
943 'tel_adh' => '+33 2 50 03 01 12',
944 'activite_adh' => true,
946 'date_crea_adh' => '2020-08-14',
948 'fingerprint' => 'FAKER_3',
951 'nom_adh' => 'Robert',
952 'prenom_adh' => 'Grégoire',
953 'ville_adh' => 'Delannoy-sur-Mer',
955 'adresse_adh' => '15, boulevard de Pierre',
956 'email_adh' => 'normand.matthieu@orange.fr',
957 'login_adh' => 'guilbert.louis',
958 'mdp_adh' => 'y(,HodJF*j',
959 'mdp_adh2' => 'y(,HodJF*j',
960 'bool_admin_adh' => false,
961 'bool_exempt_adh' => false,
962 'bool_display_info' => true,
964 'prof_adh' => 'Mannequin détail',
966 'ddn_adh' => '1974-05-14',
967 'lieu_naissance' => 'Barbe-sur-Laurent',
968 'pseudo_adh' => 'stoussaint',
969 'pays_adh' => 'Îles Mineures Éloignées des États-Unis',
970 'tel_adh' => '+33 (0)1 30 50 01 54',
971 'activite_adh' => true,
973 'date_crea_adh' => '2018-12-05',
974 'pref_lang' => 'it_IT',
975 'fingerprint' => 'FAKER_4',
976 'societe_adh' => 'Chretien Martineau S.A.',
977 'is_company' => true,
981 'prenom_adh' => 'Charles',
982 'ville_adh' => 'Charpentier-sur-Lebrun',
984 'adresse_adh' => '817, chemin de Bonnin',
985 'email_adh' => 'guillou.augustin@live.com',
986 'login_adh' => 'dominique80',
987 'mdp_adh' => '~g??E0HE$A>2"e*C7+Kw',
988 'mdp_adh2' => '~g??E0HE$A>2"e*C7+Kw',
989 'bool_admin_adh' => true,
990 'bool_exempt_adh' => false,
991 'bool_display_info' => true,
993 'prof_adh' => 'Commandant de police',
995 'ddn_adh' => '2007-03-26',
996 'lieu_naissance' => 'Boutin',
997 'pseudo_adh' => 'virginie.jacquet',
999 'tel_adh' => '0393209420',
1000 'activite_adh' => true,
1002 'date_crea_adh' => '2018-02-17',
1003 'pref_lang' => 'fr_FR',
1004 'fingerprint' => 'FAKER_5',
1006 'FAKER_6' => array (
1007 'nom_adh' => 'Thierry',
1008 'prenom_adh' => 'Louis',
1009 'ville_adh' => 'Henry',
1010 'cp_adh' => '98 144',
1011 'adresse_adh' => '383, avenue Éléonore Bouchet',
1012 'email_adh' => 'bernard.elodie@orange.fr',
1013 'login_adh' => 'ubreton',
1014 'mdp_adh' => 'lTBT@,hsE`co?C2=',
1015 'mdp_adh2' => 'lTBT@,hsE`co?C2=',
1016 'bool_admin_adh' => false,
1017 'bool_exempt_adh' => false,
1018 'bool_display_info' => false,
1020 'prof_adh' => 'Endocrinologue',
1021 'titre_adh' => null,
1022 'ddn_adh' => '1994-07-19',
1023 'lieu_naissance' => 'Pagesdan',
1024 'pseudo_adh' => 'diallo.sebastien',
1026 'tel_adh' => '+33 5 72 28 24 81',
1027 'activite_adh' => true,
1029 'date_crea_adh' => '2020-03-16',
1030 'pref_lang' => 'en_US',
1031 'fingerprint' => 'FAKER_6',
1033 'FAKER_7' => array (
1034 'nom_adh' => 'Delattre',
1035 'prenom_adh' => 'Susanne',
1036 'ville_adh' => 'Roche-les-Bains',
1037 'cp_adh' => '37 104',
1038 'adresse_adh' => '44, rue Suzanne Guilbert',
1039 'email_adh' => 'tmartel@wanadoo.fr',
1040 'login_adh' => 'lebreton.alexandre',
1041 'mdp_adh' => '{(3mCWC7[YL]n',
1042 'mdp_adh2' => '{(3mCWC7[YL]n',
1043 'bool_admin_adh' => false,
1044 'bool_exempt_adh' => false,
1045 'bool_display_info' => true,
1047 'prof_adh' => 'Gérant d\'hôtel',
1048 'titre_adh' => null,
1049 'ddn_adh' => '1914-05-16',
1050 'lieu_naissance' => 'Traore',
1051 'pseudo_adh' => 'helene59',
1053 'tel_adh' => '0383453389',
1054 'activite_adh' => true,
1056 'date_crea_adh' => '2020-02-03',
1057 'pref_lang' => 'oc',
1058 'fingerprint' => 'FAKER_7',
1060 'FAKER_8' => array (
1061 'nom_adh' => 'Peltier',
1062 'prenom_adh' => 'Inès',
1063 'ville_adh' => 'Thierry-sur-Carre',
1064 'cp_adh' => '80690',
1065 'adresse_adh' => '43, impasse Texier',
1066 'email_adh' => 'qdubois@mendes.fr',
1067 'login_adh' => 'julie.carlier',
1068 'mdp_adh' => '.ATai-E6%LIxE{',
1069 'mdp_adh2' => '.ATai-E6%LIxE{',
1070 'bool_admin_adh' => false,
1071 'bool_exempt_adh' => false,
1072 'bool_display_info' => true,
1074 'prof_adh' => 'Gynécologue',
1075 'titre_adh' => null,
1076 'ddn_adh' => '1988-05-29',
1077 'lieu_naissance' => 'Dijoux-sur-Michaud',
1078 'pseudo_adh' => 'wpierre',
1080 'tel_adh' => '01 32 14 47 74',
1081 'activite_adh' => true,
1083 'date_crea_adh' => '2020-03-28',
1084 'pref_lang' => 'ar',
1085 'fingerprint' => 'FAKER_8',
1087 'FAKER_9' => array (
1088 'nom_adh' => 'Marchand',
1089 'prenom_adh' => 'Audrey',
1090 'ville_adh' => 'Lenoirdan',
1091 'cp_adh' => '06494',
1092 'adresse_adh' => '438, place de Carre',
1093 'email_adh' => 'luc42@yahoo.fr',
1094 'login_adh' => 'margot.bousquet',
1095 'mdp_adh' => 'FH,q5udclwM(',
1096 'mdp_adh2' => 'FH,q5udclwM(',
1097 'bool_admin_adh' => false,
1098 'bool_exempt_adh' => false,
1099 'bool_display_info' => true,
1101 'prof_adh' => 'Convoyeur garde',
1102 'titre_adh' => null,
1103 'ddn_adh' => '1977-09-02',
1104 'lieu_naissance' => 'Arnaud-sur-Antoine',
1105 'pseudo_adh' => 'gerard66',
1107 'tel_adh' => '+33 1 46 04 81 87',
1108 'activite_adh' => true,
1110 'date_crea_adh' => '2019-05-16',
1111 'pref_lang' => 'fr_FR',
1112 'fingerprint' => 'FAKER_9',
1118 * Get second set of member data but two lines without name.
1122 private function getMemberData2NoName()
1124 $data = $this->getMemberData2();
1125 $data['FAKER_2']['nom_adh'] = '';
1126 $data['FAKER_5']['nom_adh'] = '';