MigrateAccessTest.php in Drupal 10
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 {
protected static $modules = [
'migrate_drupal_ui',
];
protected $defaultTheme = 'stark';
public function testAccess() {
$this
->drupalLogin($this->rootUser);
$this
->drupalGet('upgrade');
$this
->assertSession()
->statusCodeEquals(200);
$this
->assertSession()
->pageTextContains('Upgrade');
$user = $this
->createUser([
'administer software updates',
]);
$this
->drupalLogin($user);
$this
->drupalGet('upgrade');
$this
->assertSession()
->statusCodeEquals(403);
$this
->assertSession()
->pageTextNotContains('Upgrade');
}
}