ExtlinkTestBase.php in External Links 8
File
tests/src/FunctionalJavascript/ExtlinkTestBase.php
View source
<?php
namespace Drupal\Tests\extlink\FunctionalJavascript;
use Drupal\FunctionalJavascriptTests\WebDriverTestBase;
use Drupal\filter\Entity\FilterFormat;
use Drupal\Tests\TestFileCreationTrait;
abstract class ExtlinkTestBase extends WebDriverTestBase {
protected $defaultTheme = 'stark';
public static $modules = [
'extlink',
'node',
'filter',
'image',
];
protected $adminUser;
protected $normalUser;
protected $emptyFormat;
const EXTLINK_ADMIN_PATH = 'admin/config/user-interface/extlink';
const EXTLINK_EXT_XPATH = '//*[local-name() = "svg" and @class="ext"]';
const EXTLINK_MAILTO_XPATH = '//*[local-name() = "svg" and @class="mailto"]';
use TestFileCreationTrait {
getTestFiles as drupalGetTestFiles;
}
public function setUp() {
parent::setUp();
$permissions = [];
$this->normalUser = $this
->drupalCreateUser($permissions);
$permissions[] = 'administer extlink';
$permissions[] = 'administer permissions';
$this->adminUser = $this
->drupalCreateUser($permissions);
$this->adminUser->roles[] = 'administrator';
$this->adminUser
->save();
$this
->drupalCreateContentType([
'type' => 'page',
]);
$this->emptyFormat = FilterFormat::create([
'format' => 'empty_format',
'name' => 'Empty format',
]);
$this->emptyFormat
->save();
}
}