You are here

public function RngViewsTest::testRegisterLinkNoAccess in RNG - Events and Registrations 8.2

Same name and namespace in other branches
  1. 8 tests/src/Kernel/Views/RngViewsTest.php \Drupal\Tests\rng\Kernel\Views\RngViewsTest::testRegisterLinkNoAccess()
  2. 3.x tests/src/Kernel/Views/RngViewsTest.php \Drupal\Tests\rng\Kernel\Views\RngViewsTest::testRegisterLinkNoAccess()

Test register link field with no access produces empty field.

File

tests/src/Kernel/Views/RngViewsTest.php, line 142

Class

RngViewsTest
Tests RNG field plugins.

Namespace

Drupal\Tests\rng\Kernel\Views

Code

public function testRegisterLinkNoAccess() {
  $this
    ->createEvent();
  $user1 = $this
    ->drupalCreateUser([
    'rng register self',
  ]);
  $this
    ->setCurrentUser($user1);
  $this
    ->createUserRoleRules([], []);
  $this->view->displayHandlers
    ->get('default')
    ->overrideOption('fields', [
    'rng_event_register' => [
      'table' => 'entity_test',
      'field' => 'rng_event_register',
      'id' => 'rng_event_register',
      'plugin_id' => 'rng_event_register',
      'entity_type' => 'entity_test',
    ],
  ]);
  $this->view
    ->save();
  $this->view
    ->preview();
  $expected = '';
  $actual = $this->view->style_plugin
    ->getField(0, 'rng_event_register');
  $this
    ->assertEqual($actual, $expected);
}