You are here

public function BibciteEntityTest::testContributorCategoryRoutes in Bibliography & Citation 8

Same name and namespace in other branches
  1. 2.0.x modules/bibcite_entity/tests/src/Functional/BibciteEntityTest.php \Drupal\Tests\bibcite_entity\Functional\BibciteEntityTest::testContributorCategoryRoutes()

Test Contributor category routes.

File

modules/bibcite_entity/tests/src/Functional/BibciteEntityTest.php, line 282

Class

BibciteEntityTest
Test for entity functions.

Namespace

Drupal\Tests\bibcite_entity\Functional

Code

public function testContributorCategoryRoutes() {
  $this
    ->drupalGet('admin/structure/bibcite/contributor/settings/category/primary');
  $this
    ->assertSession()
    ->statusCodeEquals(403);
  $this
    ->drupalGet('admin/structure/bibcite/contributor/settings/category/primary/delete');
  $this
    ->assertSession()
    ->statusCodeEquals(403);
  $this
    ->drupalGet('admin/structure/bibcite/contributor/settings/category/add');
  $this
    ->assertSession()
    ->statusCodeEquals(403);
  $this
    ->drupalGet('admin/structure/bibcite/contributor/settings/category');
  $this
    ->assertSession()
    ->statusCodeEquals(403);
  $this
    ->drupalLogin($this->user);
  $this
    ->drupalGet('admin/structure/bibcite/contributor/settings/category/primary');
  $this
    ->assertSession()
    ->statusCodeEquals(200);
  $this
    ->drupalGet('admin/structure/bibcite/contributor/settings/category/primary/delete');
  $this
    ->assertSession()
    ->statusCodeEquals(200);
  $this
    ->drupalGet('admin/structure/bibcite/contributor/settings/category/add');
  $this
    ->assertSession()
    ->statusCodeEquals(200);
  $this
    ->drupalGet('admin/structure/bibcite/contributor/settings/category');
  $this
    ->assertSession()
    ->statusCodeEquals(200);
  $this
    ->drupalLogin($this->simpleUser);
  $this
    ->drupalGet('admin/structure/bibcite/contributor/settings/category/primary');
  $this
    ->assertSession()
    ->statusCodeEquals(403);
  $this
    ->drupalGet('admin/structure/bibcite/contributor/settings/category/primary/delete');
  $this
    ->assertSession()
    ->statusCodeEquals(403);
  $this
    ->drupalGet('admin/structure/bibcite/contributor/settings/category/add');
  $this
    ->assertSession()
    ->statusCodeEquals(403);
  $this
    ->drupalGet('admin/structure/bibcite/contributor/settings/category');
  $this
    ->assertSession()
    ->statusCodeEquals(403);
}