You are here

protected function FontYourFaceFontDisplayTest::setUp in @font-your-face 8.3

Overrides BrowserTestBase::setUp

File

tests/src/Functional/FontYourFaceFontDisplayTest.php, line 37

Class

FontYourFaceFontDisplayTest
Tests that font displays show css.

Namespace

Drupal\Tests\fontyourface\Functional

Code

protected function setUp() {
  parent::setUp();

  // Create and log in an administrative user.
  $this->adminUser = $this
    ->drupalCreateUser([
    'administer font entities',
  ]);
  $this
    ->drupalLogin($this->adminUser);

  // Set up default themes.
  \Drupal::service('theme_handler')
    ->install([
    'bartik',
    'seven',
  ]);
  $this
    ->config('system.theme')
    ->set('default', 'bartik')
    ->set('admin', 'seven')
    ->save();

  // Enable Arial font.
  $this
    ->drupalGet(Url::fromRoute('font.settings'));
  $this
    ->submitForm([
    'load_all_enabled_fonts' => FALSE,
  ], 'Save configuration');
  $this
    ->drupalGet(Url::fromRoute('font.settings'));
  $this
    ->submitForm([], 'Import from websafe_fonts_test');
}