FontYourFaceInstallTest.php in @font-your-face 8.3
File
tests/src/Functional/FontYourFaceInstallTest.php
View source
<?php
namespace Drupal\Tests\fontyourface\Functional;
use Drupal\Core\Url;
use Drupal\Tests\BrowserTestBase;
class FontYourFaceInstallTest extends BrowserTestBase {
protected $defaultTheme = 'stark';
public static $modules = [];
protected $adminUser;
protected function setUp() {
parent::setUp();
\Drupal::service('module_installer')
->install([
'views',
'fontyourface',
]);
$this->adminUser = $this
->drupalCreateUser([
'administer font entities',
]);
$this
->drupalLogin($this->adminUser);
}
public function testFontYourFaceSections() {
$this
->drupalGet(Url::fromRoute('entity.font.collection'));
$this
->assertText(t('Font Selector'));
$this
->drupalGet(Url::fromRoute('entity.font_display.collection'));
$this
->assertText(t('There are no font display entities yet.'));
$this
->drupalGet(Url::fromRoute('entity.font_display.add_form'));
$this
->assertText(t('Please enable at least one font before creating/updating a font style.'));
$this
->drupalGet(Url::fromRoute('font.settings'));
$this
->assertText(t('Settings form for @font-your-face. Support modules can use this form for settings or to import fonts.'));
$this
->assertSession()
->responseContains(t('Import all fonts'));
}
}