configurable csv/xlsx export templates (#5531)

This commit is contained in:
Kevin Papst
2025-06-11 13:06:33 +02:00
committed by GitHub
parent 46129c7ab9
commit 05aaa1950a
83 changed files with 2632 additions and 412 deletions

View File

@@ -12,6 +12,8 @@ namespace App\Tests\Form\Extension;
use App\Form\Extension\DocumentationLinkExtension;
use PHPUnit\Framework\TestCase;
use Symfony\Component\Form\Extension\Core\Type\FormType;
use Symfony\Component\Form\FormInterface;
use Symfony\Component\Form\FormView;
use Symfony\Component\OptionsResolver\Exception\InvalidOptionsException;
use Symfony\Component\OptionsResolver\OptionsResolver;
@@ -43,4 +45,18 @@ class DocumentationLinkExtensionTest extends TestCase
$this->expectException(InvalidOptionsException::class);
$resolver->resolve(['docu_chapter' => true]);
}
public function testBuildView(): void
{
$sut = new DocumentationLinkExtension();
$form = $this->createMock(FormInterface::class);
$view = new FormView();
$sut->buildView($view, $form, ['docu_chapter' => null]);
self::assertEquals(['attr' => [], 'value' => null, 'docu_chapter' => null], $view->vars);
$view = new FormView();
$sut->buildView($view, $form, ['docu_chapter' => 'customers']);
self::assertEquals(['attr' => [], 'value' => null, 'docu_chapter' => 'customers'], $view->vars);
}
}