Files
admin.juergenandClaude Fable 5.1 142afa6e52 Initial version of the W&K sync bundle for Contao 5.7
Import of W&K seminar exports with preview, booking form via form generator
with event-dependent field rules, notification routing, inbox with folders
and CSV export for W&K.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-09-24 17:42:34 +02:00

32 lines
1002 B
PHP

<?php
declare(strict_types=1);
namespace Mummert\ContaoWkSyncBundle\Tests\Import;
use Mummert\ContaoWkSyncBundle\Import\TextFormatter;
use PHPUnit\Framework\TestCase;
class TextFormatterTest extends TestCase
{
public function testParagraphsEscapeHtml(): void
{
$html = (new TextFormatter())->paragraphs("<b>fett</b> & mehr\r\n\r\nzweiter");
self::assertSame("<p>&lt;b&gt;fett&lt;/b&gt; &amp; mehr</p>\n<p>zweiter</p>", $html);
}
public function testTopicsBecomeList(): void
{
$html = (new TextFormatter())->topics("Einleitung\n- Punkt A\n- Punkt B\nFortsetzung B\n- Punkt C");
self::assertSame("<p>Einleitung</p>\n<ul><li>Punkt A</li><li>Punkt B<br>Fortsetzung B</li><li>Punkt C</li></ul>", $html);
}
public function testTopicsWithoutDashesAreParagraphs(): void
{
self::assertSame('<p>Nur Text</p>', (new TextFormatter())->topics('Nur Text'));
self::assertSame('', (new TextFormatter())->topics(" \n "));
}
}