You are here

public function TaxonomyPermissionsTestBase::testAccessTermPage in Taxonomy Permissions 8

Tests if a user without permissions can access to term's page.

File

src/Tests/TaxonomyPermissionsTestBase.php, line 158

Class

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

Namespace

Drupal\taxonomy_permissions\Tests

Code

public function testAccessTermPage() {
  $this
    ->drupalLogin($this->authorizedUser);
  $this
    ->drupalGet("taxonomy/term/{$this->term1->id()}");
  $this
    ->assertResponse(200);
  $this
    ->drupalLogin($this->basicUser);
  $this
    ->drupalGet("taxonomy/term/{$this->term1->id()}");
  $this
    ->assertResponse(403);
}