3 /* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */
10 * Copyright © 2020-2023 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-2023 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
33 * @link http://galette.tuxfamily.org
37 namespace Galette\IO\test\units
;
39 use PHPUnit\Framework\TestCase
;
40 use Galette\Entity\Adherent
;
41 use Galette\DynamicFields\DynamicField
;
42 use Galette\GaletteTestCase
;
49 * @package GaletteTests
50 * @author Johan Cwiklinski <johan@x-tnd.be>
51 * @copyright 2020-2023 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 GaletteTestCase
58 private ?
string $contents_table = null;
65 public function setUp(): void
68 $this->contents_table
= null;
76 public function tearDown(): void
80 $delete = $this->zdb
->delete(\Galette\Entity\Adherent
::TABLE
);
81 $this->zdb
->execute($delete);
82 $delete = $this->zdb
->delete(\Galette\Entity\DynamicFieldsHandle
::TABLE
);
83 $this->zdb
->execute($delete);
84 $delete = $this->zdb
->delete(DynamicField
::TABLE
);
85 $this->zdb
->execute($delete);
86 //cleanup dynamic translations
87 $delete = $this->zdb
->delete(\Galette\Core\L10n
::TABLE
);
90 'Dynamic choice field',
95 $this->zdb
->execute($delete);
97 if ($this->contents_table
!== null) {
98 $this->zdb
->drop($this->contents_table
);
103 * Import text CSV file
105 * @param array $fields Fields name to use at import
106 * @param string $file_name File name
107 * @param array $flash_messages Expected flash messages from doImport route
108 * @param array $members_list List of faked members data
109 * @param integer $count_before Count before insertions. Defaults to 0 if null.
110 * @param integer $count_after Count after insertions. Default to $count_before + count $members_list
111 * @param array $values Textual values for dynamic choices fields
115 private function doImportFileTest(
118 array $flash_messages,
120 $count_before = null,
124 if ($count_before === null) {
127 if ($count_after === null) {
128 $count_after = $count_before +
count($members_list);
131 $members = new \Galette\Repository\
Members();
132 $list = $members->getList();
136 print_r(debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS
, 1), true)
139 $model = $this->getModel($fields);
141 //get csv model file to add data in
142 $controller = new \Galette\Controllers\
CsvController($this->container
);
143 $this->container
->injectOn($controller);
145 $rfactory = new \Slim\Psr7\Factory\
RequestFactory();
146 $request = $rfactory->createRequest('GET', 'http://localhost/models/csv');
147 $response = new \Slim\Psr7\
Response();
149 $response = $controller->getImportModel($request, $response);
150 $csvin = new \Galette\IO\
CsvIn($this->container
->get('zdb'));
152 $this->assertSame(200, $response->getStatusCode());
153 $headers = $response->getHeaders();
154 $this->assertIsArray($headers);
155 $this->assertSame(['text/csv'], $headers['Content-Type']);
157 ['attachment;filename="galette_import_model.csv"'],
158 $headers['Content-Disposition']
161 $csvfile_model = $response->getBody()->__toString();
163 "\"" . implode("\";\"", $fields) . "\"\r\n",
167 $contents = $csvfile_model;
168 foreach ($members_list as $member) {
170 foreach ($fields as $field) {
171 $amember[$field] = $member[$field];
173 $contents .= "\"" . implode("\";\"", $amember) . "\"\r\n";
176 $path = GALETTE_CACHE_DIR
. $file_name;
177 $this->assertIsInt(file_put_contents($path, $contents));
178 $_FILES['new_file'] = [
179 'error' => UPLOAD_ERR_OK
,
180 'name' => $file_name,
182 'size' => filesize($path)
184 $this->assertTrue($csvin->store($_FILES['new_file'], true));
185 $this->assertTrue(file_exists($csvin->getDestDir() . $csvin->getFileName()));
188 'import_file' => $file_name
191 $request = clone $request;
192 $request = $request->withParsedBody($post);
194 $response = $controller->doImports($request, $response);
195 $this->assertSame(301, $response->getStatusCode());
196 $this->assertSame($flash_messages, $this->flash_data
['slimFlash']);
197 $this->flash
->clearMessages();
199 $members = new \Galette\Repository\
Members();
200 $list = $members->getList();
201 $this->assertSame($count_after, $list->count());
203 if ($count_before != $count_after) {
204 foreach ($list as $member) {
205 $created = $members_list[$member->fingerprint
];
206 foreach ($fields as $field) {
207 if (property_exists($member, $field)) {
208 $this->assertEquals($created[$field], $member->$field);
210 //manage dynamic fields
212 if (preg_match('/^dynfield_(\d+)/', $field, $matches)) {
213 $adh = new Adherent($this->zdb
, (int)$member->id_adh
, ['dynamics' => true]);
216 'item_id' => $adh->id
,
217 'field_form' => 'adh',
219 'field_val' => $created[$field]
223 $dfield = $adh->getDynamicFields()->getValues($matches[1]);
224 if (isset($dfield[0]['text_val'])) {
225 //choice, add textual value
226 $expected[0]['text_val'] = $values[$created[$field]];
231 $adh->getDynamicFields()->getValues($matches[1])
234 throw new \
RuntimeException("Unknown field $field");
243 * Test CSV import loading
247 public function testImport()
249 $fields = ['nom_adh', 'ville_adh', 'bool_exempt_adh', 'fingerprint'];
250 $file_name = 'test-import-atoum.csv';
252 'success_detected' => ["File '$file_name' has been successfully imported :)"]
254 $members_list = $this->getMemberData1();
258 $this->doImportFileTest($fields, $file_name, $flash_messages, $members_list, $count_before, $count_after);
261 $file_name = 'test-import-atoum-noname.csv';
263 'error_detected' => [
264 'File does not comply with requirements.',
265 'Field nom_adh is required, but missing in row 3'
269 $members_list = $this->getMemberData2NoName();
273 $this->doImportFileTest($fields, $file_name, $flash_messages, $members_list, $count_before, $count_after);
277 * Get CSV import model
279 * @param array $fields Fields list
281 * @return \Galette\Entity\ImportModel
283 protected function getModel($fields): \Galette\Entity\ImportModel
285 $model = new \Galette\Entity\
ImportModel();
286 $this->assertTrue($model->remove($this->zdb
));
288 $this->assertInstanceOf(\Galette\Entity\ImportModel
::class, $model->setFields($fields));
289 $this->assertTrue($model->store($this->zdb
));
290 $this->assertTrue($model->load());
295 * Test dynamic translation has been added properly
297 * @param string $text_orig Original text
298 * @param string $lang Lang text has been added in
302 protected function checkDynamicTranslation($text_orig, $lang = 'fr_FR.utf8')
304 $langs = array_keys($this->i18n
->getArrayList());
305 $select = $this->zdb
->select(\Galette\Core\L10n
::TABLE
);
311 $select->where(['text_orig' => $text_orig]);
312 $results = $this->zdb
->execute($select);
313 $this->assertSame(count($langs), $results->count());
315 foreach ($results as $result) {
316 $this->assertTrue(in_array(str_replace('.utf8', '', $result['text_locale']), $langs));
317 $this->assertSame(1, (int)$result['text_nref']);
319 ($result['text_locale'] == 'en_US' ?
$text_orig : ''),
320 $result['text_trans']
326 * Test import with dynamic fields
330 public function testImportDynamics()
334 'form_name' => 'adh',
335 'field_name' => 'Dynamic text field',
336 'field_perm' => DynamicField
::PERM_USER_WRITE
,
337 'field_type' => DynamicField
::TEXT
,
338 'field_required' => 1,
342 $df = DynamicField
::getFieldType($this->zdb
, $field_data['field_type']);
344 $stored = $df->store($field_data);
345 $error_detected = $df->getErrors();
346 $warning_detected = $df->getWarnings();
351 $df->getErrors() +
$df->getWarnings()
354 $this->assertEmpty($error_detected, implode(' ', $df->getErrors()));
355 $this->assertEmpty($warning_detected, implode(' ', $df->getWarnings()));
356 //check if dynamic translation has been added
357 $this->checkDynamicTranslation($field_data['field_name']);
359 $select = $this->zdb
->select(DynamicField
::TABLE
);
360 $select->columns(array('num' => new \Laminas\Db\Sql\
Expression('COUNT(1)')));
361 $result = $this->zdb
->execute($select)->current();
362 $this->assertSame(1, (int)$result->num
);
364 $fields = ['nom_adh', 'ville_adh', 'dynfield_' . $df->getId(), 'fingerprint'];
365 $file_name = 'test-import-atoum-dyn.csv';
367 'success_detected' => ["File '$file_name' has been successfully imported :)"]
369 $members_list = $this->getMemberData1();
370 foreach ($members_list as $fingerprint => &$data) {
371 $data['dynfield_' . $df->getId()] = 'Dynamic field value for ' . $data['fingerprint'];
376 $this->doImportFileTest($fields, $file_name, $flash_messages, $members_list, $count_before, $count_after);
379 //$fields does not change from previous
380 $file_name = 'test-import-atoum-dyn-noname.csv';
382 'error_detected' => [
383 'File does not comply with requirements.',
384 'Field nom_adh is required, but missing in row 3'
387 $members_list = $this->getMemberData2NoName();
388 foreach ($members_list as $fingerprint => &$data) {
389 $data['dynfield_' . $df->getId()] = 'Dynamic field value for ' . $data['fingerprint'];
395 $this->doImportFileTest($fields, $file_name, $flash_messages, $members_list, $count_before, $count_after);
397 //missing required dynamic field
398 //$fields does not change from previous
399 $file_name = 'test-import-atoum-dyn-nodyn.csv';
401 'error_detected' => [
402 'File does not comply with requirements.',
403 'Missing required field Dynamic text field'
406 $members_list = $this->getMemberData2();
408 foreach ($members_list as $fingerprint => &$data) {
409 //two lines without required dynamic field.
410 $data['dynfield_' . $df->getId()] = (($i == 2 ||
$i == 5) ?
'' :
411 'Dynamic field value for ' . $data['fingerprint']);
418 $this->doImportFileTest($fields, $file_name, $flash_messages, $members_list, $count_before, $count_after);
420 //cleanup members and dynamic fields values
421 $delete = $this->zdb
->delete(\Galette\Entity\Adherent
::TABLE
);
422 $this->zdb
->execute($delete);
423 $delete = $this->zdb
->delete(\Galette\Entity\DynamicFieldsHandle
::TABLE
);
424 $this->zdb
->execute($delete);
426 //new dynamic field, of type choice.
433 'form_name' => 'adh',
434 'field_name' => 'Dynamic choice field',
435 'field_perm' => DynamicField
::PERM_USER_WRITE
,
436 'field_type' => DynamicField
::CHOICE
,
437 'field_required' => 0,
439 'fixed_values' => implode("\n", $values)
442 $cdf = DynamicField
::getFieldType($this->zdb
, $cfield_data['field_type']);
444 $stored = $cdf->store($cfield_data);
445 $error_detected = $cdf->getErrors();
446 $warning_detected = $cdf->getWarnings();
451 $cdf->getErrors() +
$cdf->getWarnings()
454 $this->assertEmpty($error_detected, implode(' ', $cdf->getErrors()));
455 $this->assertEmpty($warning_detected, implode(' ', $cdf->getWarnings()));
456 //check if dynamic translation has been added
457 $this->checkDynamicTranslation($cfield_data['field_name']);
459 $select = $this->zdb
->select(DynamicField
::TABLE
);
460 $select->columns(array('num' => new \Laminas\Db\Sql\
Expression('COUNT(1)')));
461 $result = $this->zdb
->execute($select)->current();
462 $this->assertSame(2, (int)$result->num
);
464 $this->assertSame($values, $cdf->getValues());
466 $fields = ['nom_adh', 'ville_adh', 'dynfield_' . $cdf->getId(), 'fingerprint'];
467 $file_name = 'test-import-atoum-dyn-cdyn.csv';
469 'success_detected' => ["File '$file_name' has been successfully imported :)"]
471 $members_list = $this->getMemberData1();
472 foreach ($members_list as $fingerprint => &$data) {
473 //two lines without required dynamic field.
474 $data['dynfield_' . $cdf->getId()] = rand(0, 2);
480 $this->doImportFileTest(
490 //cleanup members and dynamic fields values
491 $delete = $this->zdb
->delete(\Galette\Entity\Adherent
::TABLE
);
492 $this->zdb
->execute($delete);
493 $delete = $this->zdb
->delete(\Galette\Entity\DynamicFieldsHandle
::TABLE
);
494 $this->zdb
->execute($delete);
495 //cleanup dynamic choices table
496 $this->contents_table
= $cdf->getFixedValuesTableName($cdf->getId());
498 //new dynamic field, of type date.
500 'form_name' => 'adh',
501 'field_name' => 'Dynamic date field',
502 'field_perm' => DynamicField
::PERM_USER_WRITE
,
503 'field_type' => DynamicField
::DATE
,
504 'field_required' => 0,
508 $cdf = DynamicField
::getFieldType($this->zdb
, $cfield_data['field_type']);
510 $stored = $cdf->store($cfield_data);
511 $error_detected = $cdf->getErrors();
512 $warning_detected = $cdf->getWarnings();
517 $cdf->getErrors() +
$cdf->getWarnings()
520 $this->assertEmpty($error_detected, implode(' ', $cdf->getErrors()));
521 $this->assertEmpty($warning_detected, implode(' ', $cdf->getWarnings()));
522 //check if dynamic translation has been added
523 $this->checkDynamicTranslation($cfield_data['field_name']);
525 $select = $this->zdb
->select(DynamicField
::TABLE
);
526 $select->columns(array('num' => new \Laminas\Db\Sql\
Expression('COUNT(1)')));
527 $result = $this->zdb
->execute($select)->current();
528 $this->assertSame(3, (int)$result->num
);
531 $fields = ['nom_adh', 'ville_adh', 'dynfield_' . $cdf->getId(), 'fingerprint'];
532 $file_name = 'test-import-atoum-cdyn-date.csv';
534 'success_detected' => ["File '$file_name' has been successfully imported :)"]
536 $members_list = $this->getMemberData1();
537 foreach ($members_list as $fingerprint => &$data) {
538 //two lines without required dynamic field.
539 $data['dynfield_' . $cdf->getId()] = $data['date_crea_adh'];
545 $this->doImportFileTest($fields, $file_name, $flash_messages, $members_list, $count_before, $count_after);
547 //Test with a bad date
548 //$fields does not change from previous
549 $file_name = 'test-import-atoum-cdyn-baddate.csv';
551 'error_detected' => [
552 'File does not comply with requirements.',
553 '- Wrong date format (Y-m-d) for Dynamic date field!'
556 $members_list = $this->getMemberData2();
558 foreach ($members_list as $fingerprint => &$data) {
559 //two lines without required dynamic field.
560 $data['dynfield_' . $cdf->getId()] = (($i == 2 ||
$i == 5) ?
'20200513' : $data['date_crea_adh']);
567 $this->doImportFileTest($fields, $file_name, $flash_messages, $members_list, $count_before, $count_after);
571 * Get first set of member data
575 private function getMemberData1()
579 'nom_adh' => 'Boucher',
580 'prenom_adh' => 'Roland',
581 'ville_adh' => 'Dumas',
583 'adresse_adh' => '5, chemin de Meunier',
584 'email_adh' => 'remy44@lopez.net',
585 'login_adh' => 'jean36',
586 'mdp_adh' => 'HM~OCSl[]UkZp%Y',
587 'mdp_adh2' => 'HM~OCSl[]UkZp%Y',
588 'bool_admin_adh' => false,
589 'bool_exempt_adh' => true,
590 'bool_display_info' => false,
592 'prof_adh' => 'Technicien géomètre',
594 'ddn_adh' => '1914-03-22',
595 'lieu_naissance' => 'Laurent-sur-Guyot',
596 'pseudo_adh' => 'tgonzalez',
598 'tel_adh' => '+33 8 93 53 99 52',
599 'activite_adh' => true,
601 'date_crea_adh' => '2020-03-09',
603 'fingerprint' => 'FAKER_0',
606 'nom_adh' => 'Lefebvre',
607 'prenom_adh' => 'François',
608 'ville_adh' => 'Laine',
610 'adresse_adh' => '311, rue de Costa',
611 'email_adh' => 'astrid64@masse.fr',
612 'login_adh' => 'olivier.pierre',
613 'mdp_adh' => '.4y/J>yN_QUh7Bw@NW>)',
614 'mdp_adh2' => '.4y/J>yN_QUh7Bw@NW>)',
615 'bool_admin_adh' => false,
616 'bool_exempt_adh' => false,
617 'bool_display_info' => false,
619 'prof_adh' => 'Conseiller relooking',
621 'ddn_adh' => '1989-10-31',
622 'lieu_naissance' => 'Collet',
623 'pseudo_adh' => 'agnes.evrard',
625 'tel_adh' => '0288284193',
626 'activite_adh' => true,
628 'date_crea_adh' => '2019-11-29',
630 'fingerprint' => 'FAKER_1',
633 'nom_adh' => 'Lemaire',
634 'prenom_adh' => 'Georges',
635 'ville_adh' => 'Teixeira-sur-Mer',
637 'adresse_adh' => 'place Guillaume',
638 'email_adh' => 'lefort.vincent@club-internet.fr',
639 'login_adh' => 'josette46',
640 'mdp_adh' => '(IqBaAIR',
641 'mdp_adh2' => '(IqBaAIR',
642 'bool_admin_adh' => false,
643 'bool_exempt_adh' => false,
644 'bool_display_info' => true,
646 'prof_adh' => 'Assistant logistique',
648 'ddn_adh' => '1935-09-07',
649 'lieu_naissance' => 'Ponsboeuf',
650 'pseudo_adh' => 'fgay',
652 'tel_adh' => '+33 7 45 45 19 81',
653 'activite_adh' => true,
655 'date_crea_adh' => '2019-02-03',
657 'fingerprint' => 'FAKER_2',
661 'prenom_adh' => 'Thibaut',
662 'ville_adh' => 'Mallet-sur-Prevost',
664 'adresse_adh' => '246, boulevard Daniel Mendes',
665 'email_adh' => 'ihamel@pinto.fr',
666 'login_adh' => 'josephine.fabre',
667 'mdp_adh' => '`2LrQcb9Utgm=Y\\S$',
668 'mdp_adh2' => '`2LrQcb9Utgm=Y\\S$',
669 'bool_admin_adh' => false,
670 'bool_exempt_adh' => false,
671 'bool_display_info' => true,
673 'prof_adh' => 'Aide à domicile',
675 'ddn_adh' => '1961-09-17',
676 'lieu_naissance' => 'Gomez',
677 'pseudo_adh' => 'chauvin.guillaume',
678 'pays_adh' => 'Hong Kong',
679 'tel_adh' => '+33 5 48 57 32 28',
680 'activite_adh' => true,
682 'date_crea_adh' => '2017-11-20',
683 'pref_lang' => 'nb_NO',
684 'fingerprint' => 'FAKER_3',
685 'societe_adh' => 'Jacques',
686 'is_company' => true,
689 'nom_adh' => 'Pascal',
690 'prenom_adh' => 'Isaac',
691 'ville_adh' => 'Jourdanboeuf',
693 'adresse_adh' => '5, boulevard de Boucher',
694 'email_adh' => 'valerie.becker@gmail.com',
695 'login_adh' => 'lucie08',
696 'mdp_adh' => '|%+wtMW{l',
697 'mdp_adh2' => '|%+wtMW{l',
698 'bool_admin_adh' => false,
699 'bool_exempt_adh' => false,
700 'bool_display_info' => true,
702 'prof_adh' => 'Bruiteur',
704 'ddn_adh' => '1953-12-11',
705 'lieu_naissance' => 'Foucher',
706 'pseudo_adh' => 'sauvage.dorothee',
707 'pays_adh' => 'Bangladesh',
708 'tel_adh' => '+33 4 75 14 66 56',
709 'activite_adh' => false,
711 'date_crea_adh' => '2018-08-16',
712 'pref_lang' => 'en_US',
713 'fingerprint' => 'FAKER_4',
716 'nom_adh' => 'Morvan',
717 'prenom_adh' => 'Joseph',
718 'ville_adh' => 'Noel',
720 'adresse_adh' => 'place de Barthelemy',
721 'email_adh' => 'claunay@tele2.fr',
722 'login_adh' => 'marthe.hoarau',
723 'mdp_adh' => '\'C?}vJAU>:-iE',
724 'mdp_adh2' => '\'C?}vJAU>:-iE',
725 'bool_admin_adh' => false,
726 'bool_exempt_adh' => false,
727 'bool_display_info' => true,
729 'prof_adh' => 'Opérateur du son',
731 'ddn_adh' => '1938-05-11',
732 'lieu_naissance' => 'Beguedan',
733 'pseudo_adh' => 'andre.guillou',
735 'tel_adh' => '09 26 70 06 55',
736 'activite_adh' => true,
738 'date_crea_adh' => '2018-09-28',
740 'fingerprint' => 'FAKER_5',
743 'nom_adh' => 'Lebreton',
744 'prenom_adh' => 'Emmanuelle',
745 'ville_adh' => 'Lefevre',
747 'adresse_adh' => '98, rue Moulin',
748 'email_adh' => 'zacharie77@ruiz.fr',
749 'login_adh' => 'marianne.collin',
750 'mdp_adh' => '=jG{wyE',
751 'mdp_adh2' => '=jG{wyE',
752 'bool_admin_adh' => false,
753 'bool_exempt_adh' => false,
754 'bool_display_info' => true,
756 'prof_adh' => 'Galeriste',
758 'ddn_adh' => '2001-02-01',
759 'lieu_naissance' => 'Berthelot',
760 'pseudo_adh' => 'ferreira.rene',
761 'pays_adh' => 'Tuvalu',
762 'tel_adh' => '+33 (0)7 47 56 89 70',
763 'activite_adh' => true,
765 'date_crea_adh' => '2018-01-13',
767 'fingerprint' => 'FAKER_6',
770 'nom_adh' => 'Maurice',
771 'prenom_adh' => 'Capucine',
772 'ville_adh' => 'Renaultdan',
773 'cp_adh' => '59 348',
774 'adresse_adh' => '56, avenue Grenier',
775 'email_adh' => 'didier.emmanuel@tiscali.fr',
776 'login_adh' => 'william.herve',
777 'mdp_adh' => '#7yUz#qToZ\'',
778 'mdp_adh2' => '#7yUz#qToZ\'',
779 'bool_admin_adh' => false,
780 'bool_exempt_adh' => false,
781 'bool_display_info' => true,
783 'prof_adh' => 'Cintrier-machiniste',
785 'ddn_adh' => '1984-04-17',
786 'lieu_naissance' => 'Rolland',
787 'pseudo_adh' => 'roger27',
788 'pays_adh' => 'Antilles néerlandaises',
789 'tel_adh' => '0922523762',
790 'activite_adh' => true,
792 'date_crea_adh' => '2020-02-13',
794 'fingerprint' => 'FAKER_7',
795 'societe_adh' => 'Mace',
796 'is_company' => true,
799 'nom_adh' => 'Hubert',
800 'prenom_adh' => 'Lucy',
801 'ville_adh' => 'Lagarde',
802 'cp_adh' => '22 829',
803 'adresse_adh' => '3, rue Pénélope Marie',
804 'email_adh' => 'zoe02@morvan.com',
805 'login_adh' => 'bernard.agathe',
806 'mdp_adh' => '@9di}eJyc"0s_d(',
807 'mdp_adh2' => '@9di}eJyc"0s_d(',
808 'bool_admin_adh' => false,
809 'bool_exempt_adh' => false,
810 'bool_display_info' => true,
812 'prof_adh' => 'Facteur',
814 'ddn_adh' => '2008-01-13',
815 'lieu_naissance' => 'Ribeiro',
816 'pseudo_adh' => 'julien.isabelle',
817 'pays_adh' => 'Mexique',
818 'tel_adh' => '0809527977',
819 'activite_adh' => true,
821 'date_crea_adh' => '2019-06-26',
822 'pref_lang' => 'de_DE',
823 'fingerprint' => 'FAKER_8',
826 'nom_adh' => 'Goncalves',
827 'prenom_adh' => 'Corinne',
828 'ville_adh' => 'LesageVille',
830 'adresse_adh' => '18, rue de Pinto',
831 'email_adh' => 'julien.clement@dbmail.com',
832 'login_adh' => 'xavier.nicolas',
833 'mdp_adh' => '<W0XdOj2Gp|@;W}gWh]',
834 'mdp_adh2' => '<W0XdOj2Gp|@;W}gWh]',
835 'bool_admin_adh' => false,
836 'bool_exempt_adh' => false,
837 'bool_display_info' => true,
839 'prof_adh' => 'Eleveur de volailles',
841 'ddn_adh' => '2013-09-12',
842 'lieu_naissance' => 'Breton',
843 'pseudo_adh' => 'louis.pruvost',
845 'tel_adh' => '+33 (0)6 80 24 46 58',
846 'activite_adh' => true,
848 'date_crea_adh' => '2020-08-09',
850 'fingerprint' => 'FAKER_9',
856 * Get second set of member data
857 * two lines without name.
861 private function getMemberData2()
865 'nom_adh' => 'Goncalves',
866 'prenom_adh' => 'Margot',
867 'ville_adh' => 'Alves',
869 'adresse_adh' => '43, impasse Maurice Imbert',
870 'email_adh' => 'guillou.richard@yahoo.fr',
871 'login_adh' => 'suzanne.mathieu',
872 'mdp_adh' => 'Thihk2z0',
873 'mdp_adh2' => 'Thihk2z0',
874 'bool_admin_adh' => false,
875 'bool_exempt_adh' => false,
876 'bool_display_info' => true,
878 'prof_adh' => 'Cueilleur de cerises',
880 'ddn_adh' => '2020-04-24',
881 'lieu_naissance' => 'Poulain-les-Bains',
882 'pseudo_adh' => 'olivier.roux',
883 'pays_adh' => 'République Dominicaine',
884 'tel_adh' => '08 95 04 73 14',
885 'activite_adh' => true,
887 'date_crea_adh' => '2020-07-31',
889 'fingerprint' => 'FAKER_0',
892 'nom_adh' => 'Da Silva',
893 'prenom_adh' => 'Augustin',
894 'ville_adh' => 'Perrin-sur-Masson',
896 'adresse_adh' => '154, place Boulay',
897 'email_adh' => 'marc60@moreno.fr',
898 'login_adh' => 'hoarau.maryse',
899 'mdp_adh' => '\\9Si%r/FAmz.HE4!{Q\\',
900 'mdp_adh2' => '\\9Si%r/FAmz.HE4!{Q\\',
901 'bool_admin_adh' => false,
902 'bool_exempt_adh' => false,
903 'bool_display_info' => true,
905 'prof_adh' => 'Séismologue',
907 'ddn_adh' => '1988-06-26',
908 'lieu_naissance' => 'Martel',
909 'pseudo_adh' => 'hchevalier',
910 'pays_adh' => 'Kiribati',
911 'tel_adh' => '04 55 49 80 92',
912 'activite_adh' => true,
914 'date_crea_adh' => '2020-06-02',
915 'pref_lang' => 'fr_FR',
916 'fingerprint' => 'FAKER_1',
920 'prenom_adh' => 'Laetitia',
921 'ville_adh' => 'SimonBourg',
923 'adresse_adh' => '147, chemin de Chauvet',
924 'email_adh' => 'jean.joseph@pinto.fr',
925 'login_adh' => 'marianne.bourgeois',
926 'mdp_adh' => '[oT:"ExE',
927 'mdp_adh2' => '[oT:"ExE',
928 'bool_admin_adh' => false,
929 'bool_exempt_adh' => false,
930 'bool_display_info' => true,
932 'prof_adh' => 'Porteur de hottes',
934 'ddn_adh' => '2010-03-13',
935 'lieu_naissance' => 'Gallet',
936 'pseudo_adh' => 'abarre',
937 'pays_adh' => 'Kirghizistan',
938 'tel_adh' => '07 47 63 11 31',
939 'activite_adh' => true,
941 'date_crea_adh' => '2020-10-28',
943 'fingerprint' => 'FAKER_2',
946 'nom_adh' => 'Cordier',
947 'prenom_adh' => 'Olivier',
948 'ville_adh' => 'Lacroixboeuf',
949 'cp_adh' => '58 787',
950 'adresse_adh' => '77, place Gilbert Perrier',
951 'email_adh' => 'adelaide07@yahoo.fr',
952 'login_adh' => 'riou.sebastien',
953 'mdp_adh' => '%"OC/UniE46',
954 'mdp_adh2' => '%"OC/UniE46',
955 'bool_admin_adh' => false,
956 'bool_exempt_adh' => false,
957 'bool_display_info' => false,
959 'prof_adh' => 'Oenologue',
961 'ddn_adh' => '2010-10-08',
962 'lieu_naissance' => 'Leger',
963 'pseudo_adh' => 'frederique.bernier',
965 'tel_adh' => '+33 2 50 03 01 12',
966 'activite_adh' => true,
968 'date_crea_adh' => '2020-08-14',
970 'fingerprint' => 'FAKER_3',
973 'nom_adh' => 'Robert',
974 'prenom_adh' => 'Grégoire',
975 'ville_adh' => 'Delannoy-sur-Mer',
977 'adresse_adh' => '15, boulevard de Pierre',
978 'email_adh' => 'normand.matthieu@orange.fr',
979 'login_adh' => 'guilbert.louis',
980 'mdp_adh' => 'y(,HodJF*j',
981 'mdp_adh2' => 'y(,HodJF*j',
982 'bool_admin_adh' => false,
983 'bool_exempt_adh' => false,
984 'bool_display_info' => true,
986 'prof_adh' => 'Mannequin détail',
988 'ddn_adh' => '1974-05-14',
989 'lieu_naissance' => 'Barbe-sur-Laurent',
990 'pseudo_adh' => 'stoussaint',
991 'pays_adh' => 'Îles Mineures Éloignées des États-Unis',
992 'tel_adh' => '+33 (0)1 30 50 01 54',
993 'activite_adh' => true,
995 'date_crea_adh' => '2018-12-05',
996 'pref_lang' => 'it_IT',
997 'fingerprint' => 'FAKER_4',
998 'societe_adh' => 'Chretien Martineau S.A.',
999 'is_company' => true,
1001 'FAKER_5' => array (
1003 'prenom_adh' => 'Charles',
1004 'ville_adh' => 'Charpentier-sur-Lebrun',
1005 'cp_adh' => '99129',
1006 'adresse_adh' => '817, chemin de Bonnin',
1007 'email_adh' => 'guillou.augustin@live.com',
1008 'login_adh' => 'dominique80',
1009 'mdp_adh' => '~g??E0HE$A>2"e*C7+Kw',
1010 'mdp_adh2' => '~g??E0HE$A>2"e*C7+Kw',
1011 'bool_admin_adh' => true,
1012 'bool_exempt_adh' => false,
1013 'bool_display_info' => true,
1015 'prof_adh' => 'Commandant de police',
1016 'titre_adh' => null,
1017 'ddn_adh' => '2007-03-26',
1018 'lieu_naissance' => 'Boutin',
1019 'pseudo_adh' => 'virginie.jacquet',
1021 'tel_adh' => '0393209420',
1022 'activite_adh' => true,
1024 'date_crea_adh' => '2018-02-17',
1025 'pref_lang' => 'fr_FR',
1026 'fingerprint' => 'FAKER_5',
1028 'FAKER_6' => array (
1029 'nom_adh' => 'Thierry',
1030 'prenom_adh' => 'Louis',
1031 'ville_adh' => 'Henry',
1032 'cp_adh' => '98 144',
1033 'adresse_adh' => '383, avenue Éléonore Bouchet',
1034 'email_adh' => 'bernard.elodie@orange.fr',
1035 'login_adh' => 'ubreton',
1036 'mdp_adh' => 'lTBT@,hsE`co?C2=',
1037 'mdp_adh2' => 'lTBT@,hsE`co?C2=',
1038 'bool_admin_adh' => false,
1039 'bool_exempt_adh' => false,
1040 'bool_display_info' => false,
1042 'prof_adh' => 'Endocrinologue',
1043 'titre_adh' => null,
1044 'ddn_adh' => '1994-07-19',
1045 'lieu_naissance' => 'Pagesdan',
1046 'pseudo_adh' => 'diallo.sebastien',
1048 'tel_adh' => '+33 5 72 28 24 81',
1049 'activite_adh' => true,
1051 'date_crea_adh' => '2020-03-16',
1052 'pref_lang' => 'en_US',
1053 'fingerprint' => 'FAKER_6',
1055 'FAKER_7' => array (
1056 'nom_adh' => 'Delattre',
1057 'prenom_adh' => 'Susanne',
1058 'ville_adh' => 'Roche-les-Bains',
1059 'cp_adh' => '37 104',
1060 'adresse_adh' => '44, rue Suzanne Guilbert',
1061 'email_adh' => 'tmartel@wanadoo.fr',
1062 'login_adh' => 'lebreton.alexandre',
1063 'mdp_adh' => '{(3mCWC7[YL]n',
1064 'mdp_adh2' => '{(3mCWC7[YL]n',
1065 'bool_admin_adh' => false,
1066 'bool_exempt_adh' => false,
1067 'bool_display_info' => true,
1069 'prof_adh' => 'Gérant d\'hôtel',
1070 'titre_adh' => null,
1071 'ddn_adh' => '1914-05-16',
1072 'lieu_naissance' => 'Traore',
1073 'pseudo_adh' => 'helene59',
1075 'tel_adh' => '0383453389',
1076 'activite_adh' => true,
1078 'date_crea_adh' => '2020-02-03',
1079 'pref_lang' => 'oc',
1080 'fingerprint' => 'FAKER_7',
1082 'FAKER_8' => array (
1083 'nom_adh' => 'Peltier',
1084 'prenom_adh' => 'Inès',
1085 'ville_adh' => 'Thierry-sur-Carre',
1086 'cp_adh' => '80690',
1087 'adresse_adh' => '43, impasse Texier',
1088 'email_adh' => 'qdubois@mendes.fr',
1089 'login_adh' => 'julie.carlier',
1090 'mdp_adh' => '.ATai-E6%LIxE{',
1091 'mdp_adh2' => '.ATai-E6%LIxE{',
1092 'bool_admin_adh' => false,
1093 'bool_exempt_adh' => false,
1094 'bool_display_info' => true,
1096 'prof_adh' => 'Gynécologue',
1097 'titre_adh' => null,
1098 'ddn_adh' => '1988-05-29',
1099 'lieu_naissance' => 'Dijoux-sur-Michaud',
1100 'pseudo_adh' => 'wpierre',
1102 'tel_adh' => '01 32 14 47 74',
1103 'activite_adh' => true,
1105 'date_crea_adh' => '2020-03-28',
1106 'pref_lang' => 'ar',
1107 'fingerprint' => 'FAKER_8',
1109 'FAKER_9' => array (
1110 'nom_adh' => 'Marchand',
1111 'prenom_adh' => 'Audrey',
1112 'ville_adh' => 'Lenoirdan',
1113 'cp_adh' => '06494',
1114 'adresse_adh' => '438, place de Carre',
1115 'email_adh' => 'luc42@yahoo.fr',
1116 'login_adh' => 'margot.bousquet',
1117 'mdp_adh' => 'FH,q5udclwM(',
1118 'mdp_adh2' => 'FH,q5udclwM(',
1119 'bool_admin_adh' => false,
1120 'bool_exempt_adh' => false,
1121 'bool_display_info' => true,
1123 'prof_adh' => 'Convoyeur garde',
1124 'titre_adh' => null,
1125 'ddn_adh' => '1977-09-02',
1126 'lieu_naissance' => 'Arnaud-sur-Antoine',
1127 'pseudo_adh' => 'gerard66',
1129 'tel_adh' => '+33 1 46 04 81 87',
1130 'activite_adh' => true,
1132 'date_crea_adh' => '2019-05-16',
1133 'pref_lang' => 'fr_FR',
1134 'fingerprint' => 'FAKER_9',
1140 * Get second set of member data but two lines without name.
1144 private function getMemberData2NoName()
1146 $data = $this->getMemberData2();
1147 $data['FAKER_2']['nom_adh'] = '';
1148 $data['FAKER_5']['nom_adh'] = '';