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
);
144 $rfactory = new \Slim\Psr7\Factory\
RequestFactory();
145 $request = $rfactory->createRequest('GET', 'http://localhost/models/csv');
146 $response = new \Slim\Psr7\
Response();
148 $response = $controller->getImportModel($request, $response);
149 $csvin = new \Galette\IO\
CsvIn($this->container
->get('zdb'));
151 $this->assertSame(200, $response->getStatusCode());
152 $headers = $response->getHeaders();
153 $this->assertIsArray($headers);
154 $this->assertSame(['text/csv'], $headers['Content-Type']);
156 ['attachment;filename="galette_import_model.csv"'],
157 $headers['Content-Disposition']
160 $csvfile_model = $response->getBody()->__toString();
162 "\"" . implode("\";\"", $fields) . "\"\r\n",
166 $contents = $csvfile_model;
167 foreach ($members_list as $member) {
169 foreach ($fields as $field) {
170 $amember[$field] = $member[$field];
172 $contents .= "\"" . implode("\";\"", $amember) . "\"\r\n";
175 $path = GALETTE_CACHE_DIR
. $file_name;
176 $this->assertIsInt(file_put_contents($path, $contents));
177 $_FILES['new_file'] = [
178 'error' => UPLOAD_ERR_OK
,
179 'name' => $file_name,
181 'size' => filesize($path)
183 $this->assertTrue($csvin->store($_FILES['new_file'], true));
184 $this->assertTrue(file_exists($csvin->getDestDir() . $csvin->getFileName()));
187 'import_file' => $file_name
190 $request = clone $request;
191 $request = $request->withParsedBody($post);
193 $response = $controller->doImports($request, $response);
194 $this->assertSame(301, $response->getStatusCode());
195 $this->assertSame($flash_messages, $this->flash_data
['slimFlash']);
196 $this->flash
->clearMessages();
198 $members = new \Galette\Repository\
Members();
199 $list = $members->getList();
200 $this->assertSame($count_after, $list->count());
202 if ($count_before != $count_after) {
203 foreach ($list as $member) {
204 $created = $members_list[$member->fingerprint
];
205 foreach ($fields as $field) {
206 if (property_exists($member, $field)) {
207 $this->assertEquals($created[$field], $member->$field);
209 //manage dynamic fields
211 if (preg_match('/^dynfield_(\d+)/', $field, $matches)) {
212 $adh = new Adherent($this->zdb
, (int)$member->id_adh
, ['dynamics' => true]);
215 'item_id' => $adh->id
,
216 'field_form' => 'adh',
218 'field_val' => $created[$field]
222 $dfield = $adh->getDynamicFields()->getValues($matches[1]);
223 if (isset($dfield[0]['text_val'])) {
224 //choice, add textual value
225 $expected[0]['text_val'] = $values[$created[$field]];
230 $adh->getDynamicFields()->getValues($matches[1])
233 throw new \
RuntimeException("Unknown field $field");
242 * Test CSV import loading
246 public function testImport()
248 $fields = ['nom_adh', 'ville_adh', 'bool_exempt_adh', 'fingerprint'];
249 $file_name = 'test-import-atoum.csv';
251 'success_detected' => ["File '$file_name' has been successfully imported :)"]
253 $members_list = $this->getMemberData1();
257 $this->doImportFileTest($fields, $file_name, $flash_messages, $members_list, $count_before, $count_after);
260 $file_name = 'test-import-atoum-noname.csv';
262 'error_detected' => [
263 'File does not comply with requirements.',
264 'Field nom_adh is required, but missing in row 3'
268 $members_list = $this->getMemberData2NoName();
272 $this->doImportFileTest($fields, $file_name, $flash_messages, $members_list, $count_before, $count_after);
276 * Get CSV import model
278 * @param array $fields Fields list
280 * @return \Galette\Entity\ImportModel
282 protected function getModel($fields): \Galette\Entity\ImportModel
284 $model = new \Galette\Entity\
ImportModel();
285 $this->assertTrue($model->remove($this->zdb
));
287 $this->assertInstanceOf(\Galette\Entity\ImportModel
::class, $model->setFields($fields));
288 $this->assertTrue($model->store($this->zdb
));
289 $this->assertTrue($model->load());
294 * Test dynamic translation has been added properly
296 * @param string $text_orig Original text
297 * @param string $lang Lang text has been added in
301 protected function checkDynamicTranslation($text_orig, $lang = 'fr_FR.utf8')
303 $langs = array_keys($this->i18n
->getArrayList());
304 $select = $this->zdb
->select(\Galette\Core\L10n
::TABLE
);
310 $select->where(['text_orig' => $text_orig]);
311 $results = $this->zdb
->execute($select);
312 $this->assertSame(count($langs), $results->count());
314 foreach ($results as $result) {
315 $this->assertTrue(in_array(str_replace('.utf8', '', $result['text_locale']), $langs));
316 $this->assertSame(1, (int)$result['text_nref']);
318 ($result['text_locale'] == 'en_US' ?
$text_orig : ''),
319 $result['text_trans']
325 * Test import with dynamic fields
329 public function testImportDynamics()
333 'form_name' => 'adh',
334 'field_name' => 'Dynamic text field',
335 'field_perm' => DynamicField
::PERM_USER_WRITE
,
336 'field_type' => DynamicField
::TEXT
,
337 'field_required' => 1,
341 $df = DynamicField
::getFieldType($this->zdb
, $field_data['field_type']);
343 $stored = $df->store($field_data);
344 $error_detected = $df->getErrors();
345 $warning_detected = $df->getWarnings();
350 $df->getErrors() +
$df->getWarnings()
353 $this->assertEmpty($error_detected, implode(' ', $df->getErrors()));
354 $this->assertEmpty($warning_detected, implode(' ', $df->getWarnings()));
355 //check if dynamic translation has been added
356 $this->checkDynamicTranslation($field_data['field_name']);
358 $select = $this->zdb
->select(DynamicField
::TABLE
);
359 $select->columns(array('num' => new \Laminas\Db\Sql\
Expression('COUNT(1)')));
360 $result = $this->zdb
->execute($select)->current();
361 $this->assertSame(1, (int)$result->num
);
363 $fields = ['nom_adh', 'ville_adh', 'dynfield_' . $df->getId(), 'fingerprint'];
364 $file_name = 'test-import-atoum-dyn.csv';
366 'success_detected' => ["File '$file_name' has been successfully imported :)"]
368 $members_list = $this->getMemberData1();
369 foreach ($members_list as $fingerprint => &$data) {
370 $data['dynfield_' . $df->getId()] = 'Dynamic field value for ' . $data['fingerprint'];
375 $this->doImportFileTest($fields, $file_name, $flash_messages, $members_list, $count_before, $count_after);
378 //$fields does not change from previous
379 $file_name = 'test-import-atoum-dyn-noname.csv';
381 'error_detected' => [
382 'File does not comply with requirements.',
383 'Field nom_adh is required, but missing in row 3'
386 $members_list = $this->getMemberData2NoName();
387 foreach ($members_list as $fingerprint => &$data) {
388 $data['dynfield_' . $df->getId()] = 'Dynamic field value for ' . $data['fingerprint'];
394 $this->doImportFileTest($fields, $file_name, $flash_messages, $members_list, $count_before, $count_after);
396 //missing required dynamic field
397 //$fields does not change from previous
398 $file_name = 'test-import-atoum-dyn-nodyn.csv';
400 'error_detected' => [
401 'File does not comply with requirements.',
402 'Missing required field Dynamic text field'
405 $members_list = $this->getMemberData2();
407 foreach ($members_list as $fingerprint => &$data) {
408 //two lines without required dynamic field.
409 $data['dynfield_' . $df->getId()] = (($i == 2 ||
$i == 5) ?
'' :
410 'Dynamic field value for ' . $data['fingerprint']);
417 $this->doImportFileTest($fields, $file_name, $flash_messages, $members_list, $count_before, $count_after);
419 //cleanup members and dynamic fields values
420 $delete = $this->zdb
->delete(\Galette\Entity\Adherent
::TABLE
);
421 $this->zdb
->execute($delete);
422 $delete = $this->zdb
->delete(\Galette\Entity\DynamicFieldsHandle
::TABLE
);
423 $this->zdb
->execute($delete);
425 //new dynamic field, of type choice.
432 'form_name' => 'adh',
433 'field_name' => 'Dynamic choice field',
434 'field_perm' => DynamicField
::PERM_USER_WRITE
,
435 'field_type' => DynamicField
::CHOICE
,
436 'field_required' => 0,
438 'fixed_values' => implode("\n", $values)
441 $cdf = DynamicField
::getFieldType($this->zdb
, $cfield_data['field_type']);
443 $stored = $cdf->store($cfield_data);
444 $error_detected = $cdf->getErrors();
445 $warning_detected = $cdf->getWarnings();
450 $cdf->getErrors() +
$cdf->getWarnings()
453 $this->assertEmpty($error_detected, implode(' ', $cdf->getErrors()));
454 $this->assertEmpty($warning_detected, implode(' ', $cdf->getWarnings()));
455 //check if dynamic translation has been added
456 $this->checkDynamicTranslation($cfield_data['field_name']);
458 $select = $this->zdb
->select(DynamicField
::TABLE
);
459 $select->columns(array('num' => new \Laminas\Db\Sql\
Expression('COUNT(1)')));
460 $result = $this->zdb
->execute($select)->current();
461 $this->assertSame(2, (int)$result->num
);
463 $this->assertSame($values, $cdf->getValues());
465 $fields = ['nom_adh', 'ville_adh', 'dynfield_' . $cdf->getId(), 'fingerprint'];
466 $file_name = 'test-import-atoum-dyn-cdyn.csv';
468 'success_detected' => ["File '$file_name' has been successfully imported :)"]
470 $members_list = $this->getMemberData1();
471 foreach ($members_list as $fingerprint => &$data) {
472 //two lines without required dynamic field.
473 $data['dynfield_' . $cdf->getId()] = rand(0, 2);
479 $this->doImportFileTest(
489 //cleanup members and dynamic fields values
490 $delete = $this->zdb
->delete(\Galette\Entity\Adherent
::TABLE
);
491 $this->zdb
->execute($delete);
492 $delete = $this->zdb
->delete(\Galette\Entity\DynamicFieldsHandle
::TABLE
);
493 $this->zdb
->execute($delete);
494 //cleanup dynamic choices table
495 $this->contents_table
= $cdf->getFixedValuesTableName($cdf->getId());
497 //new dynamic field, of type date.
499 'form_name' => 'adh',
500 'field_name' => 'Dynamic date field',
501 'field_perm' => DynamicField
::PERM_USER_WRITE
,
502 'field_type' => DynamicField
::DATE
,
503 'field_required' => 0,
507 $cdf = DynamicField
::getFieldType($this->zdb
, $cfield_data['field_type']);
509 $stored = $cdf->store($cfield_data);
510 $error_detected = $cdf->getErrors();
511 $warning_detected = $cdf->getWarnings();
516 $cdf->getErrors() +
$cdf->getWarnings()
519 $this->assertEmpty($error_detected, implode(' ', $cdf->getErrors()));
520 $this->assertEmpty($warning_detected, implode(' ', $cdf->getWarnings()));
521 //check if dynamic translation has been added
522 $this->checkDynamicTranslation($cfield_data['field_name']);
524 $select = $this->zdb
->select(DynamicField
::TABLE
);
525 $select->columns(array('num' => new \Laminas\Db\Sql\
Expression('COUNT(1)')));
526 $result = $this->zdb
->execute($select)->current();
527 $this->assertSame(3, (int)$result->num
);
530 $fields = ['nom_adh', 'ville_adh', 'dynfield_' . $cdf->getId(), 'fingerprint'];
531 $file_name = 'test-import-atoum-cdyn-date.csv';
533 'success_detected' => ["File '$file_name' has been successfully imported :)"]
535 $members_list = $this->getMemberData1();
536 foreach ($members_list as $fingerprint => &$data) {
537 //two lines without required dynamic field.
538 $data['dynfield_' . $cdf->getId()] = $data['date_crea_adh'];
544 $this->doImportFileTest($fields, $file_name, $flash_messages, $members_list, $count_before, $count_after);
546 //Test with a bad date
547 //$fields does not change from previous
548 $file_name = 'test-import-atoum-cdyn-baddate.csv';
550 'error_detected' => [
551 'File does not comply with requirements.',
552 '- Wrong date format (Y-m-d) for Dynamic date field!'
555 $members_list = $this->getMemberData2();
557 foreach ($members_list as $fingerprint => &$data) {
558 //two lines without required dynamic field.
559 $data['dynfield_' . $cdf->getId()] = (($i == 2 ||
$i == 5) ?
'20200513' : $data['date_crea_adh']);
566 $this->doImportFileTest($fields, $file_name, $flash_messages, $members_list, $count_before, $count_after);
570 * Get first set of member data
574 private function getMemberData1()
578 'nom_adh' => 'Boucher',
579 'prenom_adh' => 'Roland',
580 'ville_adh' => 'Dumas',
582 'adresse_adh' => '5, chemin de Meunier',
583 'email_adh' => 'remy44@lopez.net',
584 'login_adh' => 'jean36',
585 'mdp_adh' => 'HM~OCSl[]UkZp%Y',
586 'mdp_adh2' => 'HM~OCSl[]UkZp%Y',
587 'bool_admin_adh' => false,
588 'bool_exempt_adh' => true,
589 'bool_display_info' => false,
591 'prof_adh' => 'Technicien géomètre',
593 'ddn_adh' => '1914-03-22',
594 'lieu_naissance' => 'Laurent-sur-Guyot',
595 'pseudo_adh' => 'tgonzalez',
597 'tel_adh' => '+33 8 93 53 99 52',
598 'activite_adh' => true,
600 'date_crea_adh' => '2020-03-09',
602 'fingerprint' => 'FAKER_0',
605 'nom_adh' => 'Lefebvre',
606 'prenom_adh' => 'François',
607 'ville_adh' => 'Laine',
609 'adresse_adh' => '311, rue de Costa',
610 'email_adh' => 'astrid64@masse.fr',
611 'login_adh' => 'olivier.pierre',
612 'mdp_adh' => '.4y/J>yN_QUh7Bw@NW>)',
613 'mdp_adh2' => '.4y/J>yN_QUh7Bw@NW>)',
614 'bool_admin_adh' => false,
615 'bool_exempt_adh' => false,
616 'bool_display_info' => false,
618 'prof_adh' => 'Conseiller relooking',
620 'ddn_adh' => '1989-10-31',
621 'lieu_naissance' => 'Collet',
622 'pseudo_adh' => 'agnes.evrard',
624 'tel_adh' => '0288284193',
625 'activite_adh' => true,
627 'date_crea_adh' => '2019-11-29',
629 'fingerprint' => 'FAKER_1',
632 'nom_adh' => 'Lemaire',
633 'prenom_adh' => 'Georges',
634 'ville_adh' => 'Teixeira-sur-Mer',
636 'adresse_adh' => 'place Guillaume',
637 'email_adh' => 'lefort.vincent@club-internet.fr',
638 'login_adh' => 'josette46',
639 'mdp_adh' => '(IqBaAIR',
640 'mdp_adh2' => '(IqBaAIR',
641 'bool_admin_adh' => false,
642 'bool_exempt_adh' => false,
643 'bool_display_info' => true,
645 'prof_adh' => 'Assistant logistique',
647 'ddn_adh' => '1935-09-07',
648 'lieu_naissance' => 'Ponsboeuf',
649 'pseudo_adh' => 'fgay',
651 'tel_adh' => '+33 7 45 45 19 81',
652 'activite_adh' => true,
654 'date_crea_adh' => '2019-02-03',
656 'fingerprint' => 'FAKER_2',
660 'prenom_adh' => 'Thibaut',
661 'ville_adh' => 'Mallet-sur-Prevost',
663 'adresse_adh' => '246, boulevard Daniel Mendes',
664 'email_adh' => 'ihamel@pinto.fr',
665 'login_adh' => 'josephine.fabre',
666 'mdp_adh' => '`2LrQcb9Utgm=Y\\S$',
667 'mdp_adh2' => '`2LrQcb9Utgm=Y\\S$',
668 'bool_admin_adh' => false,
669 'bool_exempt_adh' => false,
670 'bool_display_info' => true,
672 'prof_adh' => 'Aide à domicile',
674 'ddn_adh' => '1961-09-17',
675 'lieu_naissance' => 'Gomez',
676 'pseudo_adh' => 'chauvin.guillaume',
677 'pays_adh' => 'Hong Kong',
678 'tel_adh' => '+33 5 48 57 32 28',
679 'activite_adh' => true,
681 'date_crea_adh' => '2017-11-20',
682 'pref_lang' => 'nb_NO',
683 'fingerprint' => 'FAKER_3',
684 'societe_adh' => 'Jacques',
685 'is_company' => true,
688 'nom_adh' => 'Pascal',
689 'prenom_adh' => 'Isaac',
690 'ville_adh' => 'Jourdanboeuf',
692 'adresse_adh' => '5, boulevard de Boucher',
693 'email_adh' => 'valerie.becker@gmail.com',
694 'login_adh' => 'lucie08',
695 'mdp_adh' => '|%+wtMW{l',
696 'mdp_adh2' => '|%+wtMW{l',
697 'bool_admin_adh' => false,
698 'bool_exempt_adh' => false,
699 'bool_display_info' => true,
701 'prof_adh' => 'Bruiteur',
703 'ddn_adh' => '1953-12-11',
704 'lieu_naissance' => 'Foucher',
705 'pseudo_adh' => 'sauvage.dorothee',
706 'pays_adh' => 'Bangladesh',
707 'tel_adh' => '+33 4 75 14 66 56',
708 'activite_adh' => false,
710 'date_crea_adh' => '2018-08-16',
711 'pref_lang' => 'en_US',
712 'fingerprint' => 'FAKER_4',
715 'nom_adh' => 'Morvan',
716 'prenom_adh' => 'Joseph',
717 'ville_adh' => 'Noel',
719 'adresse_adh' => 'place de Barthelemy',
720 'email_adh' => 'claunay@tele2.fr',
721 'login_adh' => 'marthe.hoarau',
722 'mdp_adh' => '\'C?}vJAU>:-iE',
723 'mdp_adh2' => '\'C?}vJAU>:-iE',
724 'bool_admin_adh' => false,
725 'bool_exempt_adh' => false,
726 'bool_display_info' => true,
728 'prof_adh' => 'Opérateur du son',
730 'ddn_adh' => '1938-05-11',
731 'lieu_naissance' => 'Beguedan',
732 'pseudo_adh' => 'andre.guillou',
734 'tel_adh' => '09 26 70 06 55',
735 'activite_adh' => true,
737 'date_crea_adh' => '2018-09-28',
739 'fingerprint' => 'FAKER_5',
742 'nom_adh' => 'Lebreton',
743 'prenom_adh' => 'Emmanuelle',
744 'ville_adh' => 'Lefevre',
746 'adresse_adh' => '98, rue Moulin',
747 'email_adh' => 'zacharie77@ruiz.fr',
748 'login_adh' => 'marianne.collin',
749 'mdp_adh' => '=jG{wyE',
750 'mdp_adh2' => '=jG{wyE',
751 'bool_admin_adh' => false,
752 'bool_exempt_adh' => false,
753 'bool_display_info' => true,
755 'prof_adh' => 'Galeriste',
757 'ddn_adh' => '2001-02-01',
758 'lieu_naissance' => 'Berthelot',
759 'pseudo_adh' => 'ferreira.rene',
760 'pays_adh' => 'Tuvalu',
761 'tel_adh' => '+33 (0)7 47 56 89 70',
762 'activite_adh' => true,
764 'date_crea_adh' => '2018-01-13',
766 'fingerprint' => 'FAKER_6',
769 'nom_adh' => 'Maurice',
770 'prenom_adh' => 'Capucine',
771 'ville_adh' => 'Renaultdan',
772 'cp_adh' => '59 348',
773 'adresse_adh' => '56, avenue Grenier',
774 'email_adh' => 'didier.emmanuel@tiscali.fr',
775 'login_adh' => 'william.herve',
776 'mdp_adh' => '#7yUz#qToZ\'',
777 'mdp_adh2' => '#7yUz#qToZ\'',
778 'bool_admin_adh' => false,
779 'bool_exempt_adh' => false,
780 'bool_display_info' => true,
782 'prof_adh' => 'Cintrier-machiniste',
784 'ddn_adh' => '1984-04-17',
785 'lieu_naissance' => 'Rolland',
786 'pseudo_adh' => 'roger27',
787 'pays_adh' => 'Antilles néerlandaises',
788 'tel_adh' => '0922523762',
789 'activite_adh' => true,
791 'date_crea_adh' => '2020-02-13',
793 'fingerprint' => 'FAKER_7',
794 'societe_adh' => 'Mace',
795 'is_company' => true,
798 'nom_adh' => 'Hubert',
799 'prenom_adh' => 'Lucy',
800 'ville_adh' => 'Lagarde',
801 'cp_adh' => '22 829',
802 'adresse_adh' => '3, rue Pénélope Marie',
803 'email_adh' => 'zoe02@morvan.com',
804 'login_adh' => 'bernard.agathe',
805 'mdp_adh' => '@9di}eJyc"0s_d(',
806 'mdp_adh2' => '@9di}eJyc"0s_d(',
807 'bool_admin_adh' => false,
808 'bool_exempt_adh' => false,
809 'bool_display_info' => true,
811 'prof_adh' => 'Facteur',
813 'ddn_adh' => '2008-01-13',
814 'lieu_naissance' => 'Ribeiro',
815 'pseudo_adh' => 'julien.isabelle',
816 'pays_adh' => 'Mexique',
817 'tel_adh' => '0809527977',
818 'activite_adh' => true,
820 'date_crea_adh' => '2019-06-26',
821 'pref_lang' => 'de_DE',
822 'fingerprint' => 'FAKER_8',
825 'nom_adh' => 'Goncalves',
826 'prenom_adh' => 'Corinne',
827 'ville_adh' => 'LesageVille',
829 'adresse_adh' => '18, rue de Pinto',
830 'email_adh' => 'julien.clement@dbmail.com',
831 'login_adh' => 'xavier.nicolas',
832 'mdp_adh' => '<W0XdOj2Gp|@;W}gWh]',
833 'mdp_adh2' => '<W0XdOj2Gp|@;W}gWh]',
834 'bool_admin_adh' => false,
835 'bool_exempt_adh' => false,
836 'bool_display_info' => true,
838 'prof_adh' => 'Eleveur de volailles',
840 'ddn_adh' => '2013-09-12',
841 'lieu_naissance' => 'Breton',
842 'pseudo_adh' => 'louis.pruvost',
844 'tel_adh' => '+33 (0)6 80 24 46 58',
845 'activite_adh' => true,
847 'date_crea_adh' => '2020-08-09',
849 'fingerprint' => 'FAKER_9',
855 * Get second set of member data
856 * two lines without name.
860 private function getMemberData2()
864 'nom_adh' => 'Goncalves',
865 'prenom_adh' => 'Margot',
866 'ville_adh' => 'Alves',
868 'adresse_adh' => '43, impasse Maurice Imbert',
869 'email_adh' => 'guillou.richard@yahoo.fr',
870 'login_adh' => 'suzanne.mathieu',
871 'mdp_adh' => 'Thihk2z0',
872 'mdp_adh2' => 'Thihk2z0',
873 'bool_admin_adh' => false,
874 'bool_exempt_adh' => false,
875 'bool_display_info' => true,
877 'prof_adh' => 'Cueilleur de cerises',
879 'ddn_adh' => '2020-04-24',
880 'lieu_naissance' => 'Poulain-les-Bains',
881 'pseudo_adh' => 'olivier.roux',
882 'pays_adh' => 'République Dominicaine',
883 'tel_adh' => '08 95 04 73 14',
884 'activite_adh' => true,
886 'date_crea_adh' => '2020-07-31',
888 'fingerprint' => 'FAKER_0',
891 'nom_adh' => 'Da Silva',
892 'prenom_adh' => 'Augustin',
893 'ville_adh' => 'Perrin-sur-Masson',
895 'adresse_adh' => '154, place Boulay',
896 'email_adh' => 'marc60@moreno.fr',
897 'login_adh' => 'hoarau.maryse',
898 'mdp_adh' => '\\9Si%r/FAmz.HE4!{Q\\',
899 'mdp_adh2' => '\\9Si%r/FAmz.HE4!{Q\\',
900 'bool_admin_adh' => false,
901 'bool_exempt_adh' => false,
902 'bool_display_info' => true,
904 'prof_adh' => 'Séismologue',
906 'ddn_adh' => '1988-06-26',
907 'lieu_naissance' => 'Martel',
908 'pseudo_adh' => 'hchevalier',
909 'pays_adh' => 'Kiribati',
910 'tel_adh' => '04 55 49 80 92',
911 'activite_adh' => true,
913 'date_crea_adh' => '2020-06-02',
914 'pref_lang' => 'fr_FR',
915 'fingerprint' => 'FAKER_1',
919 'prenom_adh' => 'Laetitia',
920 'ville_adh' => 'SimonBourg',
922 'adresse_adh' => '147, chemin de Chauvet',
923 'email_adh' => 'jean.joseph@pinto.fr',
924 'login_adh' => 'marianne.bourgeois',
925 'mdp_adh' => '[oT:"ExE',
926 'mdp_adh2' => '[oT:"ExE',
927 'bool_admin_adh' => false,
928 'bool_exempt_adh' => false,
929 'bool_display_info' => true,
931 'prof_adh' => 'Porteur de hottes',
933 'ddn_adh' => '2010-03-13',
934 'lieu_naissance' => 'Gallet',
935 'pseudo_adh' => 'abarre',
936 'pays_adh' => 'Kirghizistan',
937 'tel_adh' => '07 47 63 11 31',
938 'activite_adh' => true,
940 'date_crea_adh' => '2020-10-28',
942 'fingerprint' => 'FAKER_2',
945 'nom_adh' => 'Cordier',
946 'prenom_adh' => 'Olivier',
947 'ville_adh' => 'Lacroixboeuf',
948 'cp_adh' => '58 787',
949 'adresse_adh' => '77, place Gilbert Perrier',
950 'email_adh' => 'adelaide07@yahoo.fr',
951 'login_adh' => 'riou.sebastien',
952 'mdp_adh' => '%"OC/UniE46',
953 'mdp_adh2' => '%"OC/UniE46',
954 'bool_admin_adh' => false,
955 'bool_exempt_adh' => false,
956 'bool_display_info' => false,
958 'prof_adh' => 'Oenologue',
960 'ddn_adh' => '2010-10-08',
961 'lieu_naissance' => 'Leger',
962 'pseudo_adh' => 'frederique.bernier',
964 'tel_adh' => '+33 2 50 03 01 12',
965 'activite_adh' => true,
967 'date_crea_adh' => '2020-08-14',
969 'fingerprint' => 'FAKER_3',
972 'nom_adh' => 'Robert',
973 'prenom_adh' => 'Grégoire',
974 'ville_adh' => 'Delannoy-sur-Mer',
976 'adresse_adh' => '15, boulevard de Pierre',
977 'email_adh' => 'normand.matthieu@orange.fr',
978 'login_adh' => 'guilbert.louis',
979 'mdp_adh' => 'y(,HodJF*j',
980 'mdp_adh2' => 'y(,HodJF*j',
981 'bool_admin_adh' => false,
982 'bool_exempt_adh' => false,
983 'bool_display_info' => true,
985 'prof_adh' => 'Mannequin détail',
987 'ddn_adh' => '1974-05-14',
988 'lieu_naissance' => 'Barbe-sur-Laurent',
989 'pseudo_adh' => 'stoussaint',
990 'pays_adh' => 'Îles Mineures Éloignées des États-Unis',
991 'tel_adh' => '+33 (0)1 30 50 01 54',
992 'activite_adh' => true,
994 'date_crea_adh' => '2018-12-05',
995 'pref_lang' => 'it_IT',
996 'fingerprint' => 'FAKER_4',
997 'societe_adh' => 'Chretien Martineau S.A.',
998 'is_company' => true,
1000 'FAKER_5' => array (
1002 'prenom_adh' => 'Charles',
1003 'ville_adh' => 'Charpentier-sur-Lebrun',
1004 'cp_adh' => '99129',
1005 'adresse_adh' => '817, chemin de Bonnin',
1006 'email_adh' => 'guillou.augustin@live.com',
1007 'login_adh' => 'dominique80',
1008 'mdp_adh' => '~g??E0HE$A>2"e*C7+Kw',
1009 'mdp_adh2' => '~g??E0HE$A>2"e*C7+Kw',
1010 'bool_admin_adh' => true,
1011 'bool_exempt_adh' => false,
1012 'bool_display_info' => true,
1014 'prof_adh' => 'Commandant de police',
1015 'titre_adh' => null,
1016 'ddn_adh' => '2007-03-26',
1017 'lieu_naissance' => 'Boutin',
1018 'pseudo_adh' => 'virginie.jacquet',
1020 'tel_adh' => '0393209420',
1021 'activite_adh' => true,
1023 'date_crea_adh' => '2018-02-17',
1024 'pref_lang' => 'fr_FR',
1025 'fingerprint' => 'FAKER_5',
1027 'FAKER_6' => array (
1028 'nom_adh' => 'Thierry',
1029 'prenom_adh' => 'Louis',
1030 'ville_adh' => 'Henry',
1031 'cp_adh' => '98 144',
1032 'adresse_adh' => '383, avenue Éléonore Bouchet',
1033 'email_adh' => 'bernard.elodie@orange.fr',
1034 'login_adh' => 'ubreton',
1035 'mdp_adh' => 'lTBT@,hsE`co?C2=',
1036 'mdp_adh2' => 'lTBT@,hsE`co?C2=',
1037 'bool_admin_adh' => false,
1038 'bool_exempt_adh' => false,
1039 'bool_display_info' => false,
1041 'prof_adh' => 'Endocrinologue',
1042 'titre_adh' => null,
1043 'ddn_adh' => '1994-07-19',
1044 'lieu_naissance' => 'Pagesdan',
1045 'pseudo_adh' => 'diallo.sebastien',
1047 'tel_adh' => '+33 5 72 28 24 81',
1048 'activite_adh' => true,
1050 'date_crea_adh' => '2020-03-16',
1051 'pref_lang' => 'en_US',
1052 'fingerprint' => 'FAKER_6',
1054 'FAKER_7' => array (
1055 'nom_adh' => 'Delattre',
1056 'prenom_adh' => 'Susanne',
1057 'ville_adh' => 'Roche-les-Bains',
1058 'cp_adh' => '37 104',
1059 'adresse_adh' => '44, rue Suzanne Guilbert',
1060 'email_adh' => 'tmartel@wanadoo.fr',
1061 'login_adh' => 'lebreton.alexandre',
1062 'mdp_adh' => '{(3mCWC7[YL]n',
1063 'mdp_adh2' => '{(3mCWC7[YL]n',
1064 'bool_admin_adh' => false,
1065 'bool_exempt_adh' => false,
1066 'bool_display_info' => true,
1068 'prof_adh' => 'Gérant d\'hôtel',
1069 'titre_adh' => null,
1070 'ddn_adh' => '1914-05-16',
1071 'lieu_naissance' => 'Traore',
1072 'pseudo_adh' => 'helene59',
1074 'tel_adh' => '0383453389',
1075 'activite_adh' => true,
1077 'date_crea_adh' => '2020-02-03',
1078 'pref_lang' => 'oc',
1079 'fingerprint' => 'FAKER_7',
1081 'FAKER_8' => array (
1082 'nom_adh' => 'Peltier',
1083 'prenom_adh' => 'Inès',
1084 'ville_adh' => 'Thierry-sur-Carre',
1085 'cp_adh' => '80690',
1086 'adresse_adh' => '43, impasse Texier',
1087 'email_adh' => 'qdubois@mendes.fr',
1088 'login_adh' => 'julie.carlier',
1089 'mdp_adh' => '.ATai-E6%LIxE{',
1090 'mdp_adh2' => '.ATai-E6%LIxE{',
1091 'bool_admin_adh' => false,
1092 'bool_exempt_adh' => false,
1093 'bool_display_info' => true,
1095 'prof_adh' => 'Gynécologue',
1096 'titre_adh' => null,
1097 'ddn_adh' => '1988-05-29',
1098 'lieu_naissance' => 'Dijoux-sur-Michaud',
1099 'pseudo_adh' => 'wpierre',
1101 'tel_adh' => '01 32 14 47 74',
1102 'activite_adh' => true,
1104 'date_crea_adh' => '2020-03-28',
1105 'pref_lang' => 'ar',
1106 'fingerprint' => 'FAKER_8',
1108 'FAKER_9' => array (
1109 'nom_adh' => 'Marchand',
1110 'prenom_adh' => 'Audrey',
1111 'ville_adh' => 'Lenoirdan',
1112 'cp_adh' => '06494',
1113 'adresse_adh' => '438, place de Carre',
1114 'email_adh' => 'luc42@yahoo.fr',
1115 'login_adh' => 'margot.bousquet',
1116 'mdp_adh' => 'FH,q5udclwM(',
1117 'mdp_adh2' => 'FH,q5udclwM(',
1118 'bool_admin_adh' => false,
1119 'bool_exempt_adh' => false,
1120 'bool_display_info' => true,
1122 'prof_adh' => 'Convoyeur garde',
1123 'titre_adh' => null,
1124 'ddn_adh' => '1977-09-02',
1125 'lieu_naissance' => 'Arnaud-sur-Antoine',
1126 'pseudo_adh' => 'gerard66',
1128 'tel_adh' => '+33 1 46 04 81 87',
1129 'activite_adh' => true,
1131 'date_crea_adh' => '2019-05-16',
1132 'pref_lang' => 'fr_FR',
1133 'fingerprint' => 'FAKER_9',
1139 * Get second set of member data but two lines without name.
1143 private function getMemberData2NoName()
1145 $data = $this->getMemberData2();
1146 $data['FAKER_2']['nom_adh'] = '';
1147 $data['FAKER_5']['nom_adh'] = '';