'legal', 'key' => 'impressum', 'type' => 'json', 'order' => 0, 'value' => [
'de' => ['content' => 'E-Mail: info@b2in.eu
Telefon: +49 (0) 5221 9255055'],
'en' => ['content' => 'Email: info@b2in.de, Phone: +49 (0) 5221 9255055'],
]]);
$contact = CmsContent::create(['group' => 'global', 'key' => 'contact', 'type' => 'json', 'order' => 0, 'value' => [
'de' => ['whatsapp' => '+49 521 98620100', 'note' => 'Rufen Sie 0521 98620100 an'],
]]);
$this->seed(ContactDetailsSeeder::class);
$first = [$legal->refresh()->getTranslations('value'), $contact->refresh()->getTranslations('value')];
$this->seed(ContactDetailsSeeder::class);
expect([$legal->refresh()->getTranslations('value'), $contact->refresh()->getTranslations('value')])->toBe($first)
->and($first[0]['de']['content'])->toBe('E-Mail: interior@b2in.eu
Telefon: +49 521 986 20 100')
->and($first[0]['en']['content'])->toBe('Email: interior@b2in.eu, Phone: +49 521 986 20 100')
->and($first[1]['de']['whatsapp'])->toBe('+49 521 986 20 100')
// Fließtext mit der Nummer bleibt – ersetzt wird nur der vollständige Wert.
->and($first[1]['de']['note'])->toBe('Rufen Sie 0521 98620100 an');
expect(whatsapp_link())->toBe('https://wa.me/4952198620100');
});
it('shows the new contact details on the contact page and in the legal texts', function () {
$this->get('/contact')->assertSuccessful()
->assertSee('interior@b2in.eu')->assertSee('+49 521 986 20 100')
->assertDontSee('5221 9255055')->assertDontSee('info@b2in.eu');
$this->get('/impressum')->assertSuccessful()->assertSee('interior@b2in.eu')->assertSee('+49 521 986 20 100');
$this->get('/privacy')->assertSuccessful()->assertDontSee('info@b2in.eu');
});
it('leaves no old contact details in the default texts', function () {
foreach (['de', 'en'] as $locale) {
foreach (['b2in.php', 'b2in_legal.php'] as $file) {
$text = file_get_contents(lang_path("{$locale}/{$file}"));
expect($text)->not->toContain('5221 9255055')->not->toContain('info@b2in.');
}
}
});