You are here

protected function FileTransferAuthorizeFormTest::setUp in Drupal 10

Same name and namespace in other branches
  1. 8 core/modules/update/tests/src/Functional/FileTransferAuthorizeFormTest.php \Drupal\Tests\update\Functional\FileTransferAuthorizeFormTest::setUp()
  2. 9 core/modules/update/tests/src/Functional/FileTransferAuthorizeFormTest.php \Drupal\Tests\update\Functional\FileTransferAuthorizeFormTest::setUp()

File

core/modules/update/tests/src/Functional/FileTransferAuthorizeFormTest.php, line 24

Class

FileTransferAuthorizeFormTest
Tests the Update Manager module upload via authorize.php functionality.

Namespace

Drupal\Tests\update\Functional

Code

protected function setUp() : void {
  parent::setUp();
  $admin_user = $this
    ->drupalCreateUser([
    'administer modules',
    'administer software updates',
  ]);
  $this
    ->drupalLogin($admin_user);

  // Create a local cache so the module is not downloaded from drupal.org.
  $cache_directory = _update_manager_cache_directory(TRUE);
  foreach ([
    '.tar.gz',
    '.zip',
  ] as $extension) {
    $filename = 'update_test_new_module' . $extension;
    copy(__DIR__ . '/../../update_test_new_module/8.x-1.0/' . $filename, $cache_directory . '/' . $filename);
  }
}