Upgraded drupal core with security updates
[yaffs-website] / web / core / modules / migrate_drupal_ui / tests / src / Functional / MigrateAccessTest.php
1 <?php
2
3 namespace Drupal\Tests\migrate_drupal_ui\Functional;
4
5 use Drupal\Tests\BrowserTestBase;
6
7 /**
8  * Tests that only user 1 can access the migrate UI.
9  *
10  * @group migrate_drupal_ui
11  */
12 class MigrateAccessTest extends BrowserTestBase {
13
14   /**
15    * Modules to enable.
16    *
17    * @var array
18    */
19   public static $modules = ['migrate_drupal_ui'];
20
21   /**
22    * Tests that only user 1 can access the migrate UI.
23    */
24   public function testAccess() {
25     $this->drupalLogin($this->rootUser);
26     $this->drupalGet('upgrade');
27     $this->assertResponse(200);
28     $this->assertText(t('Upgrade'));
29
30     $user = $this->createUser(['administer software updates']);
31     $this->drupalLogin($user);
32     $this->drupalGet('upgrade');
33     $this->assertResponse(403);
34     $this->assertNoText(t('Upgrade'));
35   }
36
37 }