You are here

public function TaxonomyPermissionsTestBase::testViewTerm in Taxonomy Permissions 8

Tests if a user without permissions can view terms on node.

File

src/Tests/TaxonomyPermissionsTestBase.php, line 141

Class

TaxonomyPermissionsTestBase
General setup and helper function for testing taxonomy permissions module.

Namespace

Drupal\taxonomy_permissions\Tests

Code

public function testViewTerm() {
  $this
    ->drupalLogin($this->authorizedUser);
  $this
    ->drupalGet("node/{$this->article1->id()}");
  $this
    ->assertResponse(200);
  $this
    ->assertText($this->term1
    ->getName());
  $this
    ->assertLink($this->term1
    ->getName());
  $this
    ->drupalLogin($this->basicUser);
  $this
    ->drupalGet("node/{$this->article1->id()}");
  $this
    ->assertResponse(200);
  $this
    ->assertNoText($this->term1
    ->getName());
  $this
    ->assertNoLink($this->term1
    ->getName());
}