3 namespace Drupal\Tests\user\Functional\Views;
6 * A common test base class for the user access plugin tests.
8 abstract class AccessTestBase extends UserTestBase {
15 public static $modules = ['block'];
18 * Contains a user object that has no special permissions.
20 * @var \Drupal\user\UserInterface
25 * Contains a user object that has the 'views_test_data test permission'.
27 * @var \Drupal\user\UserInterface
29 protected $normalUser;
32 * Contains a role ID that is used by the webUser.
39 * Contains a role ID that is used by the normalUser.
43 protected $normalRole;
48 protected function setUp($import_test_views = TRUE) {
49 parent::setUp($import_test_views);
50 $this->drupalPlaceBlock('system_breadcrumb_block');
52 $this->enableViewsTestModule();
54 $this->webUser = $this->drupalCreateUser();
55 $roles = $this->webUser->getRoles();
56 $this->webRole = $roles[0];
58 $this->normalRole = $this->drupalCreateRole([]);
59 $this->normalUser = $this->drupalCreateUser(['views_test_data test permission']);
60 $this->normalUser->addRole($this->normalRole);
61 $this->normalUser->save();
62 // @todo when all the plugin information is cached make a reset function and