MigrateAccessTest.php in Drupal 8
File
core/modules/migrate_drupal_ui/tests/src/Functional/MigrateAccessTest.php
View source
<?php
namespace Drupal\Tests\migrate_drupal_ui\Functional;
use Drupal\Tests\BrowserTestBase;
class MigrateAccessTest extends BrowserTestBase {
public static $modules = [
'migrate_drupal_ui',
];
protected $defaultTheme = 'stark';
public function testAccess() {
$this
->drupalLogin($this->rootUser);
$this
->drupalGet('upgrade');
$this
->assertSession()
->statusCodeEquals(200);
$this
->assertText(t('Upgrade'));
$user = $this
->createUser([
'administer software updates',
]);
$this
->drupalLogin($user);
$this
->drupalGet('upgrade');
$this
->assertSession()
->statusCodeEquals(403);
$this
->assertNoText(t('Upgrade'));
}
}