Upgraded drupal core with security updates
[yaffs-website] / web / core / modules / system / src / Tests / Ajax / AjaxInGroupTest.php
1 <?php
2
3 namespace Drupal\system\Tests\Ajax;
4
5 /**
6  * Tests that form elements in groups work correctly with AJAX.
7  *
8  * @group Ajax
9  */
10 class AjaxInGroupTest extends AjaxTestBase {
11   protected function setUp() {
12     parent::setUp();
13
14     $this->drupalLogin($this->drupalCreateUser(['access content']));
15   }
16
17   /**
18    * Submits forms with select and checkbox elements via Ajax.
19    */
20   public function testSimpleAjaxFormValue() {
21     $this->drupalGet('/ajax_forms_test_get_form');
22     $this->assertText('Test group');
23     $this->assertText('AJAX checkbox in a group');
24
25     $this->drupalPostAjaxForm(NULL, ['checkbox_in_group' => TRUE], 'checkbox_in_group');
26     $this->assertText('Test group');
27     $this->assertText('AJAX checkbox in a group');
28     $this->assertText('AJAX checkbox in a nested group');
29     $this->assertText('Another AJAX checkbox in a nested group');
30   }
31
32 }