Skip to content

Commit

Permalink
qa: Adjust factory test to correctly set value options
Browse files Browse the repository at this point in the history
Signed-off-by: George Steel <[email protected]>
  • Loading branch information
gsteel committed Nov 17, 2023
1 parent 3aec841 commit da4a9f0
Showing 1 changed file with 20 additions and 16 deletions.
36 changes: 20 additions & 16 deletions test/FactoryTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -96,9 +96,9 @@ public function testCanCreateFieldsetsWithElements(): void
'name' => 'baz',
],
'spec' => [
'attributes' => [
'type' => 'radio',
'options' => [
'type' => Form\Element\Radio::class,
'options' => [
'value_options' => [
'foo' => 'Foo Bar',
'bar' => 'Bar Baz',
],
Expand Down Expand Up @@ -130,11 +130,12 @@ public function testCanCreateFieldsetsWithElements(): void
self::assertEquals('text', $element->getAttribute('type'));

$element = $fieldset->get('baz');
self::assertInstanceOf(Form\Element\Radio::class, $element);
self::assertEquals('radio', $element->getAttribute('type'));
self::assertEquals([
'foo' => 'Foo Bar',
'bar' => 'Bar Baz',
], $element->getAttribute('options'));
], $element->getValueOptions());

$element = $fieldset->get('bat');
self::assertEquals('textarea', $element->getAttribute('type'));
Expand Down Expand Up @@ -173,9 +174,9 @@ public function testCanCreateNestedFieldsets(): void
'name' => 'baz',
],
'spec' => [
'attributes' => [
'type' => 'radio',
'options' => [
'type' => Form\Element\Radio::class,
'options' => [
'value_options' => [
'foo' => 'Foo Bar',
'bar' => 'Bar Baz',
],
Expand Down Expand Up @@ -211,11 +212,12 @@ public function testCanCreateNestedFieldsets(): void
self::assertEquals('text', $element->getAttribute('type'));

$element = $fieldset->get('baz');
self::assertInstanceOf(Form\Element\Radio::class, $element);
self::assertEquals('radio', $element->getAttribute('type'));
self::assertEquals([
'foo' => 'Foo Bar',
'bar' => 'Bar Baz',
], $element->getAttribute('options'));
], $element->getValueOptions());

$element = $fieldset->get('bat');
self::assertEquals('textarea', $element->getAttribute('type'));
Expand Down Expand Up @@ -551,9 +553,9 @@ public function testCanCreateFormWithHydratorAndInputFilterAndElementsAndFieldse
'name' => 'baz',
],
'spec' => [
'attributes' => [
'type' => 'radio',
'options' => [
'type' => Form\Element\Radio::class,
'options' => [
'value_options' => [
'foo' => 'Foo Bar',
'bar' => 'Bar Baz',
],
Expand Down Expand Up @@ -593,9 +595,9 @@ public function testCanCreateFormWithHydratorAndInputFilterAndElementsAndFieldse
'name' => 'baz',
],
'spec' => [
'attributes' => [
'type' => 'radio',
'options' => [
'type' => Form\Element\Radio::class,
'options' => [
'value_options' => [
'foo' => 'Foo Bar',
'bar' => 'Bar Baz',
],
Expand Down Expand Up @@ -633,11 +635,12 @@ public function testCanCreateFormWithHydratorAndInputFilterAndElementsAndFieldse
self::assertEquals('text', $element->getAttribute('type'));

$element = $form->get('baz');
self::assertInstanceOf(Form\Element\Radio::class, $element);
self::assertEquals('radio', $element->getAttribute('type'));
self::assertEquals([
'foo' => 'Foo Bar',
'bar' => 'Bar Baz',
], $element->getAttribute('options'));
], $element->getValueOptions());

$element = $form->get('bat');
self::assertEquals('textarea', $element->getAttribute('type'));
Expand All @@ -663,11 +666,12 @@ public function testCanCreateFormWithHydratorAndInputFilterAndElementsAndFieldse
self::assertEquals('text', $element->getAttribute('type'));

$element = $fieldset->get('baz');
self::assertInstanceOf(Form\Element\Radio::class, $element);
self::assertEquals('radio', $element->getAttribute('type'));
self::assertEquals([
'foo' => 'Foo Bar',
'bar' => 'Bar Baz',
], $element->getAttribute('options'));
], $element->getValueOptions());

$element = $fieldset->get('bat');
self::assertEquals('textarea', $element->getAttribute('type'));
Expand Down

0 comments on commit da4a9f0

Please sign in to comment.