You are here

public function BibciteEntityTest::testReferenceRoutes 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::testReferenceRoutes()

Test Reference routes.

File

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

Class

BibciteEntityTest
Test for entity functions.

Namespace

Drupal\Tests\bibcite_entity\Functional

Code

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