You are here

public function BibciteEntityTest::testKeywordRoutes in Bibliography & Citation 2.0.x

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

Test Keyword routes.

File

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

Class

BibciteEntityTest
Test for entity functions.

Namespace

Drupal\Tests\bibcite_entity\Functional

Code

public function testKeywordRoutes() {
  $this
    ->drupalGet('bibcite/keyword/1');
  $this
    ->assertSession()
    ->statusCodeEquals(403);
  $this
    ->drupalGet('bibcite/keyword/1/edit');
  $this
    ->assertSession()
    ->statusCodeEquals(403);
  $this
    ->drupalGet('bibcite/keyword/1/delete');
  $this
    ->assertSession()
    ->statusCodeEquals(403);
  $this
    ->drupalGet('bibcite/keyword/add');
  $this
    ->assertSession()
    ->statusCodeEquals(403);
  $this
    ->drupalGet('admin/content/bibcite/keyword');
  $this
    ->assertSession()
    ->statusCodeEquals(403);
  $this
    ->drupalGet('admin/content/bibcite/keyword/delete');
  $this
    ->assertSession()
    ->statusCodeEquals(403);
  $this
    ->drupalGet('admin/content/bibcite/keyword/1/merge');
  $this
    ->assertSession()
    ->statusCodeEquals(403);
  $this
    ->drupalGet('admin/content/bibcite/keyword/1/merge/2');
  $this
    ->assertSession()
    ->statusCodeEquals(403);
  $this
    ->drupalLogin($this->user);
  $this
    ->drupalGet('bibcite/keyword/1');
  $this
    ->assertSession()
    ->statusCodeEquals(200);
  $this
    ->drupalGet('bibcite/keyword/1/edit');
  $this
    ->assertSession()
    ->statusCodeEquals(200);
  $this
    ->drupalGet('bibcite/keyword/1/delete');
  $this
    ->assertSession()
    ->statusCodeEquals(200);
  $this
    ->drupalGet('bibcite/keyword/add');
  $this
    ->assertSession()
    ->statusCodeEquals(200);
  $this
    ->drupalGet('admin/content/bibcite/keyword');
  $this
    ->assertSession()
    ->statusCodeEquals(200);
  $this
    ->drupalGet('admin/content/bibcite/keyword/delete');
  $this
    ->assertSession()
    ->statusCodeEquals(200);
  $this
    ->drupalGet('admin/content/bibcite/keyword/1/merge');
  $this
    ->assertSession()
    ->statusCodeEquals(200);
  $this
    ->drupalGet('admin/content/bibcite/keyword/1/merge/2');
  $this
    ->assertSession()
    ->statusCodeEquals(200);
  $this
    ->drupalLogin($this->simpleUser);
  $this
    ->drupalGet('bibcite/keyword/1');
  $this
    ->assertSession()
    ->statusCodeEquals(403);
  $this
    ->drupalGet('bibcite/keyword/1/edit');
  $this
    ->assertSession()
    ->statusCodeEquals(403);
  $this
    ->drupalGet('bibcite/keyword/1/delete');
  $this
    ->assertSession()
    ->statusCodeEquals(403);
  $this
    ->drupalGet('bibcite/keyword/add');
  $this
    ->assertSession()
    ->statusCodeEquals(403);
  $this
    ->drupalGet('admin/content/bibcite/keyword');
  $this
    ->assertSession()
    ->statusCodeEquals(403);
  $this
    ->drupalGet('admin/content/bibcite/keyword/delete');
  $this
    ->assertSession()
    ->statusCodeEquals(403);
  $this
    ->drupalGet('admin/content/bibcite/keyword/1/merge');
  $this
    ->assertSession()
    ->statusCodeEquals(403);
  $this
    ->drupalGet('admin/content/bibcite/keyword/1/merge/2');
  $this
    ->assertSession()
    ->statusCodeEquals(403);
}