SettingsFormTest.php in Drupal 8
File
core/modules/media_library/tests/src/Functional/SettingsFormTest.php
View source
<?php
namespace Drupal\Tests\media_library\Functional;
use Drupal\Tests\BrowserTestBase;
class SettingsFormTest extends BrowserTestBase {
protected static $modules = [
'media_library',
];
protected $defaultTheme = 'stark';
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');
}
}