Files
laraundfelix/tests/Unit/BlockRegistryTest.php
T
LarsandCursor 2035c46edd
Deploy Test / test (push) Successful in 2m25s
Deploy Test / deploy (push) Failing after 25s
Stelle das U0-Fundament mit CMS, Mitgliedern und Filament bereit.
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-11-15 08:32:14 +01:00

34 lines
868 B
PHP

<?php
namespace Tests\Unit;
use App\Domain\Cms\Blocks\BlockRegistry;
use Illuminate\Validation\ValidationException;
use Tests\TestCase;
class BlockRegistryTest extends TestCase
{
public function test_image_text_requires_an_alternative_text(): void
{
$this->expectException(ValidationException::class);
app(BlockRegistry::class)->normalize([
['type' => 'image_text', 'body' => 'Text', 'image' => 'cms/bild.jpg'],
]);
}
public function test_action_links_reject_script_urls(): void
{
$this->expectException(ValidationException::class);
app(BlockRegistry::class)->normalize([
[
'type' => 'call_to_action',
'heading' => 'Weiter',
'label' => 'Öffnen',
'url' => 'javascript:alert(1)',
],
]);
}
}