Skip to content
Snippets Groups Projects
Unverified Commit bf341805 authored by Alex Pott's avatar Alex Pott
Browse files

Issue #588438 by dww: FormTest::testRequiredFields() fails to drupal_render()...

Issue #588438 by dww: FormTest::testRequiredFields() fails to drupal_render() elements of #type 'radios'

(cherry picked from commit 4731e3c6)
parent 2f5eb025
Branches
Tags
18 merge requests!10011Issue #3200534 by quietone, longwave, Kristen Pol: Use dataprovider for...,!3134Issue #3222236: Lighthouse SEO: Uncrawlable Link a#main-content,!2571Issue #3000717: Missing mapping for "nodereference_url" widget,!2521Issue #3185775: Place Views preview on the side on large monitors,!1803Issue #2329253: Allow the ChangedItem to skip updating when synchronizing (f.e. when migrating),!1603Issue #3231707: mxr576's core patch playground,!1479Issue #3250298: Return empty string "" with JSON Serializer instead of FALSE,!1478Issue #3250298: Return empty string "" with JSON Serializer instead of FALSE,!1203Issue #3236191 Wrong group exposed form widgets and multiple selection error.,!1076Issue #2903336 Added node context for tokens.,!1015Issue #3226944: REST's Request handler doesn't resolve $data argument for put method,!810Issue #3219541: Remove redudante call $this->requestStack->getCurrentRequest() in FormBuilder::buildForm,!803Issue #3219167: webchick test issue of all time turbo edition super star 20000 NG,!740Issue #3216088: Update Symfony 5 components to 5.3,!577Issue #3209779: Create new database storage for the tracker module,!526Update block module to use once library,!516Issue #3207782: Figure out BC for jquery once by @drupal/once,!35Issue #3164686 WebAssert::addressEquals() and AssertLegacyTrait::assertUrl() fail to check the querystring
......@@ -124,11 +124,7 @@ public function testRequiredFields() {
\Drupal::formBuilder()->prepareForm($form_id, $form, $form_state);
\Drupal::formBuilder()->processForm($form_id, $form, $form_state);
$errors = $form_state->getErrors();
// Form elements of type 'radios' throw all sorts of PHP notices
// when you try to render them like this, so we ignore those for
// testing the required marker.
// @todo Fix this work-around (https://www.drupal.org/node/588438).
$form_output = ($type == 'radios') ? '' : \Drupal::service('renderer')->renderRoot($form);
$form_output = \Drupal::service('renderer')->renderRoot($form);
if ($required) {
// Make sure we have a form error for this element.
$this->assertTrue(isset($errors[$element]), "Check empty($key) '$type' field '$element'");
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment