You are here

public function BibciteTest::testAddStyleForm in Bibliography & Citation 2.0.x

Same name and namespace in other branches
  1. 8 tests/src/Functional/BibciteTest.php \Drupal\Tests\bibcite\Functional\BibciteTest::testAddStyleForm()

Test AddStyle form.

File

tests/src/Functional/BibciteTest.php, line 136

Class

BibciteTest
Test for main module functions.

Namespace

Drupal\Tests\bibcite\Functional

Code

public function testAddStyleForm() {
  $this
    ->drupalLogin($this->user);
  $this
    ->drupalGet('admin/config/bibcite/settings/csl_style/add');
  $page = $this
    ->getSession()
    ->getPage();
  $page
    ->fillField('edit-label', 'bmj');
  $csl_file = file_get_contents(__DIR__ . '/../../styles/bmj.csl');
  $page
    ->fillField('edit-csl', $csl_file);
  $page
    ->pressButton('edit-submit');
  $this
    ->assertSession()
    ->statusCodeEquals(200);
  $this
    ->assertSession()
    ->pageTextContains('bmj');
}