You are here

protected function UpdateManagerUpdateTest::setUp in Drupal 8

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

Overrides UpdateTestBase::setUp

File

core/modules/update/tests/src/Functional/UpdateManagerUpdateTest.php, line 34

Class

UpdateManagerUpdateTest
Tests the Update Manager module's 'Update' form and functionality.

Namespace

Drupal\Tests\update\Functional

Code

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

  // The installed state of the system is the same for all test cases. What
  // varies for each test scenario is which release history fixture we fetch,
  // which in turn changes the expected state of the UpdateManagerUpdateForm.
  $system_info = [
    '#all' => [
      'version' => '8.0.0',
    ],
    'aaa_update_test' => [
      'project' => 'aaa_update_test',
      'version' => '8.x-1.0',
      'hidden' => FALSE,
    ],
    'bbb_update_test' => [
      'project' => 'bbb_update_test',
      'version' => '8.x-1.0',
      'hidden' => FALSE,
    ],
  ];
  $this
    ->config('update_test.settings')
    ->set('system_info', $system_info)
    ->save();
}