OptionsWidgetsTest.php 21.7 KB
Newer Older
1 2
<?php

3
/**
4
 * @file
5
 * Definition of Drupal\options\Tests\OptionsWidgetsTest.
6 7
 */

8 9 10 11 12 13 14 15
namespace Drupal\options\Tests;

use Drupal\field\Tests\FieldTestBase;

/**
 * Test the Options widgets.
 */
class OptionsWidgetsTest extends FieldTestBase {
16 17 18 19 20 21

  /**
   * Modules to enable.
   *
   * @var array
   */
22
  public static $modules = array('options', 'entity_test', 'options_test', 'taxonomy', 'field_ui');
23

24 25 26
 /**
   * A field with cardinality 1 to use in this test class.
   *
27
   * @var \Drupal\field\Entity\Field
28 29 30 31 32 33
   */
  protected $card_1;

  /**
   * A field with cardinality 2 to use in this test class.
   *
34
   * @var \Drupal\field\Entity\Field
35 36 37 38 39 40
   */
  protected $card_2;

  /**
   * A boolean field to use in this test class.
   *
41
   * @var \Drupal\field\Entity\Field
42 43 44 45 46 47 48 49 50 51 52
   */
  protected $bool;

  /**
   * A user with permission to view and manage entities.
   *
   * @var \Drupal\user\UserInterface
   */
  protected $web_user;


53 54 55 56
  public static function getInfo() {
    return array(
      'name'  => 'Options widgets',
      'description'  => "Test the Options widgets.",
57
      'group' => 'Field types'
58 59 60 61
    );
  }

  function setUp() {
62
    parent::setUp();
63

64
    // Field with cardinality 1.
65
    $this->card_1 = entity_create('field_entity', array(
66 67
      'name' => 'card_1',
      'entity_type' => 'entity_test',
68
      'type' => 'list_integer',
69 70
      'cardinality' => 1,
      'settings' => array(
71
        // Make sure that 0 works as an option.
72
        'allowed_values' => array(0 => 'Zero', 1 => 'One', 2 => 'Some <script>dangerous</script> & unescaped <strong>markup</strong>'),
73
      ),
74 75
    ));
    $this->card_1->save();
76

77
    // Field with cardinality 2.
78
    $this->card_2 = entity_create('field_entity', array(
79 80
      'name' => 'card_2',
      'entity_type' => 'entity_test',
81
      'type' => 'list_integer',
82 83
      'cardinality' => 2,
      'settings' => array(
84
        // Make sure that 0 works as an option.
85
        'allowed_values' => array(0 => 'Zero', 1 => 'One', 2 => 'Some <script>dangerous</script> & unescaped <strong>markup</strong>'),
86
      ),
87 88
    ));
    $this->card_2->save();
89

90
    // Boolean field.
91
    $this->bool = entity_create('field_entity', array(
92 93
      'name' => 'bool',
      'entity_type' => 'entity_test',
94 95 96
      'type' => 'list_boolean',
      'cardinality' => 1,
      'settings' => array(
97
        'allowed_values' => array(0 => 'Zero', 1 => 'Some <script>dangerous</script> & unescaped <strong>markup</strong>'),
98
      ),
99 100
    ));
    $this->bool->save();
101

102
    // Create a web user.
103
    $this->web_user = $this->drupalCreateUser(array('view test entity', 'administer entity_test content'));
104
    $this->drupalLogin($this->web_user);
105 106 107
  }

  /**
108
   * Tests the 'options_buttons' widget (single select).
109 110
   */
  function testRadioButtons() {
111
    // Create an instance of the 'single value' field.
112
    $instance = entity_create('field_instance', array(
113
      'field_name' => $this->card_1->getFieldName(),
114 115
      'entity_type' => 'entity_test',
      'bundle' => 'entity_test',
116 117
    ));
    $instance->save();
118
    entity_get_form_display('entity_test', 'entity_test', 'default')
119
      ->setComponent($this->card_1->getFieldName(), array(
120 121 122 123
        'type' => 'options_buttons',
      ))
      ->save();

124
    // Create an entity.
125 126 127 128 129 130
    $entity = entity_create('entity_test', array(
      'user_id' => 1,
      'name' => $this->randomName(),
    ));
    $entity->save();
    $entity_init = clone $entity;
131 132

    // With no field data, no buttons are checked.
133
    $this->drupalGet('entity_test/manage/' . $entity->id());
134 135 136
    $this->assertNoFieldChecked('edit-card-1-0');
    $this->assertNoFieldChecked('edit-card-1-1');
    $this->assertNoFieldChecked('edit-card-1-2');
137
    $this->assertRaw('Some dangerous &amp; unescaped <strong>markup</strong>', 'Option text was properly filtered.');
138 139

    // Select first option.
140
    $edit = array('card_1' => 0);
141
    $this->drupalPostForm(NULL, $edit, t('Save'));
142
    $this->assertFieldValues($entity_init, 'card_1', array(0));
143 144

    // Check that the selected button is checked.
145
    $this->drupalGet('entity_test/manage/' . $entity->id());
146 147 148
    $this->assertFieldChecked('edit-card-1-0');
    $this->assertNoFieldChecked('edit-card-1-1');
    $this->assertNoFieldChecked('edit-card-1-2');
149 150

    // Unselect option.
151
    $edit = array('card_1' => '_none');
152
    $this->drupalPostForm(NULL, $edit, t('Save'));
153
    $this->assertFieldValues($entity_init, 'card_1', array());
154

155
    // Check that required radios with one option is auto-selected.
156 157 158 159
    $this->card_1->settings['allowed_values'] = array(99 => 'Only allowed value');
    $this->card_1->save();
    $instance->required = TRUE;
    $instance->save();
160
    $this->drupalGet('entity_test/manage/' . $entity->id());
161
    $this->assertFieldChecked('edit-card-1-99');
162 163
  }

164 165 166
  /**
   * Tests the 'options_buttons' widget (multiple select).
   */
167
  function testCheckBoxes() {
168
    // Create an instance of the 'multiple values' field.
169
    $instance = entity_create('field_instance', array(
170
      'field_name' => $this->card_2->getFieldName(),
171 172
      'entity_type' => 'entity_test',
      'bundle' => 'entity_test',
173 174
    ));
    $instance->save();
175
    entity_get_form_display('entity_test', 'entity_test', 'default')
176
      ->setComponent($this->card_2->getFieldName(), array(
177 178 179 180
        'type' => 'options_buttons',
      ))
      ->save();

181
    // Create an entity.
182 183 184 185 186 187
    $entity = entity_create('entity_test', array(
      'user_id' => 1,
      'name' => $this->randomName(),
    ));
    $entity->save();
    $entity_init = clone $entity;
188

189
    // Display form: with no field data, nothing is checked.
190
    $this->drupalGet('entity_test/manage/' . $entity->id());
191 192 193
    $this->assertNoFieldChecked('edit-card-2-0');
    $this->assertNoFieldChecked('edit-card-2-1');
    $this->assertNoFieldChecked('edit-card-2-2');
194
    $this->assertRaw('Some dangerous &amp; unescaped <strong>markup</strong>', 'Option text was properly filtered.');
195 196 197

    // Submit form: select first and third options.
    $edit = array(
198 199 200
      'card_2[0]' => TRUE,
      'card_2[1]' => FALSE,
      'card_2[2]' => TRUE,
201
    );
202
    $this->drupalPostForm(NULL, $edit, t('Save'));
203
    $this->assertFieldValues($entity_init, 'card_2', array(0, 2));
204 205

    // Display form: check that the right options are selected.
206
    $this->drupalGet('entity_test/manage/' . $entity->id());
207 208 209
    $this->assertFieldChecked('edit-card-2-0');
    $this->assertNoFieldChecked('edit-card-2-1');
    $this->assertFieldChecked('edit-card-2-2');
210 211 212

    // Submit form: select only first option.
    $edit = array(
213 214 215
      'card_2[0]' => TRUE,
      'card_2[1]' => FALSE,
      'card_2[2]' => FALSE,
216
    );
217
    $this->drupalPostForm(NULL, $edit, t('Save'));
218
    $this->assertFieldValues($entity_init, 'card_2', array(0));
219

220
    // Display form: check that the right options are selected.
221
    $this->drupalGet('entity_test/manage/' . $entity->id());
222 223 224
    $this->assertFieldChecked('edit-card-2-0');
    $this->assertNoFieldChecked('edit-card-2-1');
    $this->assertNoFieldChecked('edit-card-2-2');
225 226 227

    // Submit form: select the three options while the field accepts only 2.
    $edit = array(
228 229 230
      'card_2[0]' => TRUE,
      'card_2[1]' => TRUE,
      'card_2[2]' => TRUE,
231
    );
232
    $this->drupalPostForm(NULL, $edit, t('Save'));
233
    $this->assertText('this field cannot hold more than 2 values', 'Validation error was displayed.');
234 235 236

    // Submit form: uncheck all options.
    $edit = array(
237 238 239
      'card_2[0]' => FALSE,
      'card_2[1]' => FALSE,
      'card_2[2]' => FALSE,
240
    );
241
    $this->drupalPostForm(NULL, $edit, t('Save'));
242
    // Check that the value was saved.
243
    $this->assertFieldValues($entity_init, 'card_2', array());
244 245

    // Required checkbox with one option is auto-selected.
246 247 248 249
    $this->card_2->settings['allowed_values'] = array(99 => 'Only allowed value');
    $this->card_2->save();
    $instance->required = TRUE;
    $instance->save();
250
    $this->drupalGet('entity_test/manage/' . $entity->id());
251
    $this->assertFieldChecked('edit-card-2-99');
252 253
  }

254 255 256 257 258
  /**
   * Tests the 'options_select' widget (single select).
   */
  function testSelectListSingle() {
    // Create an instance of the 'single value' field.
259
    $instance = entity_create('field_instance', array(
260
      'field_name' => $this->card_1->getFieldName(),
261 262
      'entity_type' => 'entity_test',
      'bundle' => 'entity_test',
263
      'required' => TRUE,
264 265
    ));
    $instance->save();
266
    entity_get_form_display('entity_test', 'entity_test', 'default')
267
      ->setComponent($this->card_1->getFieldName(), array(
268 269 270 271
        'type' => 'options_select',
      ))
      ->save();

272
    // Create an entity.
273 274 275 276 277 278
    $entity = entity_create('entity_test', array(
      'user_id' => 1,
      'name' => $this->randomName(),
    ));
    $entity->save();
    $entity_init = clone $entity;
279

280
    // Display form.
281
    $this->drupalGet('entity_test/manage/' . $entity->id());
282
    // A required field without any value has a "none" option.
283
    $this->assertTrue($this->xpath('//select[@id=:id]//option[@value="_none" and text()=:label]', array(':id' => 'edit-card-1', ':label' => t('- Select a value -'))), 'A required select list has a "Select a value" choice.');
284 285

    // With no field data, nothing is selected.
286 287 288 289
    $this->assertNoOptionSelected('edit-card-1', '_none');
    $this->assertNoOptionSelected('edit-card-1', 0);
    $this->assertNoOptionSelected('edit-card-1', 1);
    $this->assertNoOptionSelected('edit-card-1', 2);
290
    $this->assertRaw('Some dangerous &amp; unescaped markup', 'Option text was properly filtered.');
291

292
    // Submit form: select invalid 'none' option.
293
    $edit = array('card_1' => '_none');
294
    $this->drupalPostForm(NULL, $edit, t('Save'));
295
    $this->assertRaw(t('!title field is required.', array('!title' => $instance->getFieldName())), 'Cannot save a required field when selecting "none" from the select list.');
296

297
    // Submit form: select first option.
298
    $edit = array('card_1' => 0);
299
    $this->drupalPostForm(NULL, $edit, t('Save'));
300
    $this->assertFieldValues($entity_init, 'card_1', array(0));
301 302

    // Display form: check that the right options are selected.
303
    $this->drupalGet('entity_test/manage/' . $entity->id());
304
    // A required field with a value has no 'none' option.
305 306 307 308
    $this->assertFalse($this->xpath('//select[@id=:id]//option[@value="_none"]', array(':id' => 'edit-card-1')), 'A required select list with an actual value has no "none" choice.');
    $this->assertOptionSelected('edit-card-1', 0);
    $this->assertNoOptionSelected('edit-card-1', 1);
    $this->assertNoOptionSelected('edit-card-1', 2);
309

310
    // Make the field non required.
311 312
    $instance->required = FALSE;
    $instance->save();
313 314

    // Display form.
315
    $this->drupalGet('entity_test/manage/' . $entity->id());
316
    // A non-required field has a 'none' option.
317
    $this->assertTrue($this->xpath('//select[@id=:id]//option[@value="_none" and text()=:label]', array(':id' => 'edit-card-1', ':label' => t('- None -'))), 'A non-required select list has a "None" choice.');
318
    // Submit form: Unselect the option.
319
    $edit = array('card_1' => '_none');
320
    $this->drupalPostForm('entity_test/manage/' . $entity->id(), $edit, t('Save'));
321
    $this->assertFieldValues($entity_init, 'card_1', array());
322

323 324
    // Test optgroups.

325 326
    $this->card_1->settings['allowed_values'] = array();
    $this->card_1->settings['allowed_values_function'] = 'options_test_allowed_values_callback';
327
    $this->card_1->save();
328 329

    // Display form: with no field data, nothing is selected
330
    $this->drupalGet('entity_test/manage/' . $entity->id());
331 332 333
    $this->assertNoOptionSelected('edit-card-1', 0);
    $this->assertNoOptionSelected('edit-card-1', 1);
    $this->assertNoOptionSelected('edit-card-1', 2);
334 335
    $this->assertRaw('Some dangerous &amp; unescaped markup', 'Option text was properly filtered.');
    $this->assertRaw('Group 1', 'Option groups are displayed.');
336 337

    // Submit form: select first option.
338
    $edit = array('card_1' => 0);
339
    $this->drupalPostForm(NULL, $edit, t('Save'));
340
    $this->assertFieldValues($entity_init, 'card_1', array(0));
341 342

    // Display form: check that the right options are selected.
343
    $this->drupalGet('entity_test/manage/' . $entity->id());
344 345 346
    $this->assertOptionSelected('edit-card-1', 0);
    $this->assertNoOptionSelected('edit-card-1', 1);
    $this->assertNoOptionSelected('edit-card-1', 2);
347 348

    // Submit form: Unselect the option.
349
    $edit = array('card_1' => '_none');
350
    $this->drupalPostForm('entity_test/manage/' . $entity->id(), $edit, t('Save'));
351
    $this->assertFieldValues($entity_init, 'card_1', array());
352 353 354 355 356 357 358
  }

  /**
   * Tests the 'options_select' widget (multiple select).
   */
  function testSelectListMultiple() {
    // Create an instance of the 'multiple values' field.
359
    $instance = entity_create('field_instance', array(
360
      'field_name' => $this->card_2->getFieldName(),
361 362
      'entity_type' => 'entity_test',
      'bundle' => 'entity_test',
363 364
    ));
    $instance->save();
365
    entity_get_form_display('entity_test', 'entity_test', 'default')
366
      ->setComponent($this->card_2->getFieldName(), array(
367 368 369 370
        'type' => 'options_select',
      ))
      ->save();

371
    // Create an entity.
372 373 374 375 376 377
    $entity = entity_create('entity_test', array(
      'user_id' => 1,
      'name' => $this->randomName(),
    ));
    $entity->save();
    $entity_init = clone $entity;
378

379
    // Display form: with no field data, nothing is selected.
380
    $this->drupalGet('entity_test/manage/' . $entity->id());
381 382 383
    $this->assertNoOptionSelected('edit-card-2', 0);
    $this->assertNoOptionSelected('edit-card-2', 1);
    $this->assertNoOptionSelected('edit-card-2', 2);
384
    $this->assertRaw('Some dangerous &amp; unescaped markup', 'Option text was properly filtered.');
385

386
    // Submit form: select first and third options.
387
    $edit = array('card_2[]' => array(0 => 0, 2 => 2));
388
    $this->drupalPostForm(NULL, $edit, t('Save'));
389
    $this->assertFieldValues($entity_init, 'card_2', array(0, 2));
390

391
    // Display form: check that the right options are selected.
392
    $this->drupalGet('entity_test/manage/' . $entity->id());
393 394 395
    $this->assertOptionSelected('edit-card-2', 0);
    $this->assertNoOptionSelected('edit-card-2', 1);
    $this->assertOptionSelected('edit-card-2', 2);
396

397
    // Submit form: select only first option.
398
    $edit = array('card_2[]' => array(0 => 0));
399
    $this->drupalPostForm(NULL, $edit, t('Save'));
400
    $this->assertFieldValues($entity_init, 'card_2', array(0));
401 402

    // Display form: check that the right options are selected.
403
    $this->drupalGet('entity_test/manage/' . $entity->id());
404 405 406
    $this->assertOptionSelected('edit-card-2', 0);
    $this->assertNoOptionSelected('edit-card-2', 1);
    $this->assertNoOptionSelected('edit-card-2', 2);
407 408

    // Submit form: select the three options while the field accepts only 2.
409
    $edit = array('card_2[]' => array(0 => 0, 1 => 1, 2 => 2));
410
    $this->drupalPostForm(NULL, $edit, t('Save'));
411
    $this->assertText('this field cannot hold more than 2 values', 'Validation error was displayed.');
412 413

    // Submit form: uncheck all options.
414
    $edit = array('card_2[]' => array());
415
    $this->drupalPostForm(NULL, $edit, t('Save'));
416
    $this->assertFieldValues($entity_init, 'card_2', array());
417 418 419

    // Test the 'None' option.

420
    // Check that the 'none' option has no effect if actual options are selected
421
    // as well.
422
    $edit = array('card_2[]' => array('_none' => '_none', 0 => 0));
423
    $this->drupalPostForm('entity_test/manage/' . $entity->id(), $edit, t('Save'));
424
    $this->assertFieldValues($entity_init, 'card_2', array(0));
425 426

    // Check that selecting the 'none' option empties the field.
427
    $edit = array('card_2[]' => array('_none' => '_none'));
428
    $this->drupalPostForm('entity_test/manage/' . $entity->id(), $edit, t('Save'));
429
    $this->assertFieldValues($entity_init, 'card_2', array());
430 431

    // A required select list does not have an empty key.
432 433
    $instance->required = TRUE;
    $instance->save();
434
    $this->drupalGet('entity_test/manage/' . $entity->id());
435
    $this->assertFalse($this->xpath('//select[@id=:id]//option[@value=""]', array(':id' => 'edit-card-2')), 'A required select list does not have an empty key.');
436

437 438
    // We do not have to test that a required select list with one option is
    // auto-selected because the browser does it for us.
439 440 441 442

    // Test optgroups.

    // Use a callback function defining optgroups.
443 444 445 446 447
    $this->card_2->settings['allowed_values'] = array();
    $this->card_2->settings['allowed_values_function'] = 'options_test_allowed_values_callback';
    $this->card_2->save();
    $instance->required = FALSE;
    $instance->save();
448 449

    // Display form: with no field data, nothing is selected.
450
    $this->drupalGet('entity_test/manage/' . $entity->id());
451 452 453
    $this->assertNoOptionSelected('edit-card-2', 0);
    $this->assertNoOptionSelected('edit-card-2', 1);
    $this->assertNoOptionSelected('edit-card-2', 2);
454 455
    $this->assertRaw('Some dangerous &amp; unescaped markup', 'Option text was properly filtered.');
    $this->assertRaw('Group 1', 'Option groups are displayed.');
456 457

    // Submit form: select first option.
458
    $edit = array('card_2[]' => array(0 => 0));
459
    $this->drupalPostForm(NULL, $edit, t('Save'));
460
    $this->assertFieldValues($entity_init, 'card_2', array(0));
461 462

    // Display form: check that the right options are selected.
463
    $this->drupalGet('entity_test/manage/' . $entity->id());
464 465 466
    $this->assertOptionSelected('edit-card-2', 0);
    $this->assertNoOptionSelected('edit-card-2', 1);
    $this->assertNoOptionSelected('edit-card-2', 2);
467 468

    // Submit form: Unselect the option.
469
    $edit = array('card_2[]' => array('_none' => '_none'));
470
    $this->drupalPostForm('entity_test/manage/' . $entity->id(), $edit, t('Save'));
471
    $this->assertFieldValues($entity_init, 'card_2', array());
472 473 474
  }

  /**
475
   * Tests the 'options_onoff' widget.
476
   */
477 478
  function testOnOffCheckbox() {
    // Create an instance of the 'boolean' field.
479
    entity_create('field_instance', array(
480
      'field_name' => $this->bool->getFieldName(),
481 482
      'entity_type' => 'entity_test',
      'bundle' => 'entity_test',
483
    ))->save();
484
    entity_get_form_display('entity_test', 'entity_test', 'default')
485
      ->setComponent($this->bool->getFieldName(), array(
486 487 488 489
        'type' => 'options_onoff',
      ))
      ->save();

490
    // Create an entity.
491 492 493 494 495 496
    $entity = entity_create('entity_test', array(
      'user_id' => 1,
      'name' => $this->randomName(),
    ));
    $entity->save();
    $entity_init = clone $entity;
497 498

    // Display form: with no field data, option is unchecked.
499
    $this->drupalGet('entity_test/manage/' . $entity->id());
500
    $this->assertNoFieldChecked('edit-bool');
501
    $this->assertRaw('Some dangerous &amp; unescaped <strong>markup</strong>', 'Option text was properly filtered.');
502 503

    // Submit form: check the option.
504
    $edit = array('bool' => TRUE);
505
    $this->drupalPostForm(NULL, $edit, t('Save'));
506
    $this->assertFieldValues($entity_init, 'bool', array(1));
507 508

    // Display form: check that the right options are selected.
509
    $this->drupalGet('entity_test/manage/' . $entity->id());
510
    $this->assertFieldChecked('edit-bool');
511 512

    // Submit form: uncheck the option.
513
    $edit = array('bool' => FALSE);
514
    $this->drupalPostForm(NULL, $edit, t('Save'));
515
    $this->assertFieldValues($entity_init, 'bool', array(0));
516 517

    // Display form: with 'off' value, option is unchecked.
518
    $this->drupalGet('entity_test/manage/' . $entity->id());
519
    $this->assertNoFieldChecked('edit-bool');
520
  }
521

522 523 524 525
  /**
   * Tests that the 'options_onoff' widget has a 'display_label' setting.
   */
  function testOnOffCheckboxLabelSetting() {
526 527 528
    // Create Basic page node type.
    $this->drupalCreateContentType(array('type' => 'page', 'name' => 'Basic page'));

529
    // Create admin user.
530
    $admin_user = $this->drupalCreateUser(array('access content', 'administer content types', 'administer node fields', 'administer node form display', 'administer taxonomy'));
531 532 533
    $this->drupalLogin($admin_user);

    // Create a test field instance.
534
    $field_name = 'bool';
535
    entity_create('field_entity', array(
536
      'name' => $field_name,
537 538 539 540 541 542 543
      'entity_type' => 'node',
      'type' => 'list_boolean',
      'cardinality' => 1,
      'settings' => array(
        'allowed_values' => array(0 => 'Zero', 1 => 'Some <script>dangerous</script> & unescaped <strong>markup</strong>'),
      ),
    ))->save();
544
    entity_create('field_instance', array(
545
      'field_name' => $field_name,
546 547
      'entity_type' => 'node',
      'bundle' => 'page',
548
    ))->save();
549

550
    entity_get_form_display('node', 'page', 'default')
551
      ->setComponent($field_name, array(
552 553 554 555
        'type' => 'options_onoff',
      ))
      ->save();

556 557 558
    // Go to the form display page and check if the default settings works as
    // expected.
    $fieldEditUrl = 'admin/structure/types/manage/page/form-display';
559 560
    $this->drupalGet($fieldEditUrl);

561
    // Click on the widget settings button to open the widget settings form.
562
    $this->drupalPostAjaxForm(NULL, array(), $field_name . "_settings_edit");
563

564
    $this->assertText(
565
      'Use field label instead of the "On value" as label',
566 567 568
      t('Display setting checkbox available.')
    );

569 570
    // Enable setting.
    $edit = array('fields[' . $field_name . '][settings_edit_form][settings][display_label]' => 1);
571 572
    $this->drupalPostAjaxForm(NULL, $edit, $field_name . "_plugin_settings_update");
    $this->drupalPostForm(NULL, NULL, 'Save');
573

574 575
    // Go again to the form display page and check if the setting
    // is stored and has the expected effect.
576
    $this->drupalGet($fieldEditUrl);
577 578
    $this->assertText('Use field label: Yes', 'Checking the display settings checkbox updated the value.');

579
    $this->drupalPostAjaxForm(NULL, array(), $field_name . "_settings_edit");
580
    $this->assertText(
581
      'Use field label instead of the "On value" as label',
582 583 584
      t('Display setting checkbox is available')
    );
    $this->assertFieldByXPath(
585
      '*//input[@id="edit-fields-' . $field_name . '-settings-edit-form-settings-display-label" and @value="1"]',
586 587 588
      TRUE,
      t('Display label changes label of the checkbox')
    );
589
  }
590

591
}