configurable csv/xlsx export templates (#5531)
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user