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>
32 lines
1002 B
PHP
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><b>fett</b> & 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 "));
|
|
}
|
|
}
|