From 1f547efdf669779ee0e158015c52f7560652d70a Mon Sep 17 00:00:00 2001 From: tienvx Date: Mon, 7 Feb 2022 23:29:29 +0700 Subject: [PATCH] Combine form type unit tests --- tests/Form/CollectionJsTypeTest.php | 18 +++++------------- 1 file changed, 5 insertions(+), 13 deletions(-) diff --git a/tests/Form/CollectionJsTypeTest.php b/tests/Form/CollectionJsTypeTest.php index 7df6708..f453cf4 100644 --- a/tests/Form/CollectionJsTypeTest.php +++ b/tests/Form/CollectionJsTypeTest.php @@ -38,6 +38,10 @@ public function testCustomOptions() $form = $this->factory ->create(static::TESTED_TYPE, null, [ 'entry_type' => TextType::class, + 'prototype' => true, + 'prototype_data' => 'New Tag Placeholder', + 'allow_add' => false, + 'allow_delete' => false, 'allow_move_up' => true, 'allow_move_down' => true, 'call_post_add_on_init' => true, @@ -49,25 +53,13 @@ public function testCustomOptions() ], $form->getConfig()->getOption('entry_options')); $view = $form->createView(); + $this->assertInstanceOf(FormView::class, $view->vars['prototype']); $this->assertTrue($view->vars['allow_move_up']); $this->assertTrue($view->vars['allow_move_down']); $this->assertTrue($view->vars['call_post_add_on_init']); $this->assertSame('__test__', $view->vars['prototype_name']); } - public function testDontAllowAdd() - { - $form = $this->factory - ->create(static::TESTED_TYPE, null, [ - 'entry_type' => TextType::class, - 'allow_add' => false, - ]) - ; - - $view = $form->createView(); - $this->assertInstanceOf(FormView::class, $view->vars['prototype']); - } - public function testDisablePrototype() { $this->expectExceptionObject(new InvalidConfigurationException(sprintf('You must enable prototype for form type %s.', static::TESTED_TYPE)));