function SettingsFormTest::testSettingsForm

Same name in this branch
  1. 10 core/modules/jsonapi/tests/src/Functional/SettingsFormTest.php \Drupal\Tests\jsonapi\Functional\SettingsFormTest::testSettingsForm()
  2. 10 core/modules/layout_builder/tests/src/Functional/SettingsFormTest.php \Drupal\Tests\layout_builder\Functional\SettingsFormTest::testSettingsForm()
Same name in other branches
  1. 9 core/modules/media_library/tests/src/Functional/SettingsFormTest.php \Drupal\Tests\media_library\Functional\SettingsFormTest::testSettingsForm()
  2. 8.9.x core/modules/media_library/tests/src/Functional/SettingsFormTest.php \Drupal\Tests\media_library\Functional\SettingsFormTest::testSettingsForm()
  3. 11.x core/modules/jsonapi/tests/src/Functional/SettingsFormTest.php \Drupal\Tests\jsonapi\Functional\SettingsFormTest::testSettingsForm()
  4. 11.x core/modules/media_library/tests/src/Functional/SettingsFormTest.php \Drupal\Tests\media_library\Functional\SettingsFormTest::testSettingsForm()
  5. 11.x core/modules/layout_builder/tests/src/Functional/SettingsFormTest.php \Drupal\Tests\layout_builder\Functional\SettingsFormTest::testSettingsForm()

Tests the Media Library settings form.

File

core/modules/media_library/tests/src/Functional/SettingsFormTest.php, line 30

Class

SettingsFormTest
Tests the Media Library settings form.

Namespace

Drupal\Tests\media_library\Functional

Code

public function testSettingsForm() : void {
    $account = $this->drupalCreateUser([
        'access administration pages',
        'administer media',
    ]);
    $this->drupalLogin($account);
    $page = $this->getSession()
        ->getPage();
    $assert_session = $this->assertSession();
    $this->drupalGet('/admin/config');
    $page->clickLink('Media Library settings');
    $page->checkField('Enable advanced UI');
    $page->pressButton('Save configuration');
    $assert_session->checkboxChecked('Enable advanced UI');
    $page->uncheckField('Enable advanced UI');
    $page->pressButton('Save configuration');
    $assert_session->checkboxNotChecked('Enable advanced UI');
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.