class SettingsFormTest in Drupal 10
Same name and namespace in other branches
- 8 core/modules/media_library/tests/src/Functional/SettingsFormTest.php \Drupal\Tests\media_library\Functional\SettingsFormTest
- 9 core/modules/media_library/tests/src/Functional/SettingsFormTest.php \Drupal\Tests\media_library\Functional\SettingsFormTest
Tests the Media Library settings form.
@coversDefaultClass \Drupal\media_library\Form\SettingsForm @group media_library
Hierarchy
- class \Drupal\Tests\BrowserTestBase extends \PHPUnit\Framework\TestCase uses \Symfony\Bridge\PhpUnit\ExpectDeprecationTrait, \Drupal\Tests\PhpUnitCompatibilityTrait, FunctionalTestSetupTrait, TestSetupTrait, BlockCreationTrait, ConfigTestTrait, ExtensionListTestTrait, ContentTypeCreationTrait, NodeCreationTrait, RandomGeneratorTrait, TestRequirementsTrait, PhpUnitWarnings, UiHelperTrait, UserCreationTrait, XdebugRequestTrait
- class \Drupal\Tests\media_library\Functional\SettingsFormTest
Expanded class hierarchy of SettingsFormTest
File
- core/
modules/ media_library/ tests/ src/ Functional/ SettingsFormTest.php, line 13
Namespace
Drupal\Tests\media_library\FunctionalView source
class SettingsFormTest extends BrowserTestBase {
/**
* {@inheritdoc}
*/
protected static $modules = [
'media_library',
];
/**
* {@inheritdoc}
*/
protected $defaultTheme = 'stark';
/**
* Tests the Media Library settings form.
*/
public function testSettingsForm() {
$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');
}
}