You are here

protected function ExternalFormUrlTest::setUp in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/modules/system/src/Tests/Form/ExternalFormUrlTest.php \Drupal\system\Tests\Form\ExternalFormUrlTest::setUp()

Performs setup tasks before each individual test method is run.

Overrides KernelTestBase::setUp

File

core/modules/system/src/Tests/Form/ExternalFormUrlTest.php, line 59
Contains \Drupal\system\Tests\Form\ExternalFormUrlTest.

Class

ExternalFormUrlTest
Ensures that form actions can't be tricked into sending to external URLs.

Namespace

Drupal\system\Tests\Form

Code

protected function setUp() {
  parent::setUp();
  $this
    ->installSchema('system', [
    'key_value_expire',
    'sequences',
  ]);
  $this
    ->installEntitySchema('user');
  $test_user = User::create([
    'name' => 'foobar',
    'mail' => 'foobar@example.com',
  ]);
  $test_user
    ->save();
  \Drupal::service('current_user')
    ->setAccount($test_user);
}