Add email column to csv
This commit is contained in:
parent
ef0672334c
commit
7ff735acac
|
@ -22,7 +22,7 @@ class ExportAction
|
||||||
{
|
{
|
||||||
$csv = Writer::createFromString();
|
$csv = Writer::createFromString();
|
||||||
|
|
||||||
$csv->insertOne(['Nachname', 'Vorname', 'Adresse', 'PLZ', 'Ort', 'Haupt-Telefon', 'Mobiltelefon', 'Arbeits-Telefon']);
|
$csv->insertOne(['Nachname', 'Vorname', 'Adresse', 'PLZ', 'Ort', 'Haupt-Telefon', 'Mobiltelefon', 'Arbeits-Telefon', 'E-Mail-Adresse']);
|
||||||
|
|
||||||
foreach ($members as $member) {
|
foreach ($members as $member) {
|
||||||
$csv->insertOne([
|
$csv->insertOne([
|
||||||
|
@ -34,6 +34,7 @@ class ExportAction
|
||||||
$member->main_phone,
|
$member->main_phone,
|
||||||
$member->mobile_phone,
|
$member->mobile_phone,
|
||||||
$member->work_phone,
|
$member->work_phone,
|
||||||
|
$member->email,
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -19,7 +19,7 @@ class ExportCsvActionTest extends TestCase
|
||||||
Storage::fake('temp');
|
Storage::fake('temp');
|
||||||
|
|
||||||
$this->withoutExceptionHandling()->login()->loginNami();
|
$this->withoutExceptionHandling()->login()->loginNami();
|
||||||
Member::factory()->defaults()->postBillKind()->create(['firstname' => 'Jane', 'main_phone' => '+49 176 70343221']);
|
Member::factory()->defaults()->postBillKind()->create(['firstname' => 'Jane', 'main_phone' => '+49 176 70343221', 'email' => 'max@muster.de']);
|
||||||
Member::factory()->defaults()->emailBillKind()->create(['firstname' => 'Max']);
|
Member::factory()->defaults()->emailBillKind()->create(['firstname' => 'Max']);
|
||||||
|
|
||||||
$response = $this->callFilter('member-export', ['bill_kind' => 'Post']);
|
$response = $this->callFilter('member-export', ['bill_kind' => 'Post']);
|
||||||
|
@ -28,6 +28,7 @@ class ExportCsvActionTest extends TestCase
|
||||||
$contents = Storage::disk('temp')->get('mitglieder.csv');
|
$contents = Storage::disk('temp')->get('mitglieder.csv');
|
||||||
$this->assertTrue(str_contains($contents, 'Jane'));
|
$this->assertTrue(str_contains($contents, 'Jane'));
|
||||||
$this->assertTrue(str_contains($contents, '+49 176 70343221'));
|
$this->assertTrue(str_contains($contents, '+49 176 70343221'));
|
||||||
|
$this->assertTrue(str_contains($contents, 'max@muster.de'));
|
||||||
$this->assertFalse(str_contains($contents, 'Max'));
|
$this->assertFalse(str_contains($contents, 'Max'));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue