You are here

public function ImportTest::testPopulateForm in Bibliography & Citation 2.0.x

Same name and namespace in other branches
  1. 8 modules/bibcite_import/tests/src/Functional/ImportTest.php \Drupal\Tests\bibcite_import\Functional\ImportTest::testPopulateForm()

Test Populate form.

@dataProvider importDataProvider

File

modules/bibcite_import/tests/src/Functional/ImportTest.php, line 68

Class

ImportTest
Test for main import functions.

Namespace

Drupal\Tests\bibcite_import\Functional

Code

public function testPopulateForm($input_data, $format, $title, $year) {
  $this
    ->drupalLogin($this->user);
  $this
    ->drupalGet('admin/content/bibcite/reference/populate');
  $page = $this
    ->getSession()
    ->getPage();
  $page
    ->fillField('edit-data', $input_data);
  $page
    ->selectFieldOption('edit-format', $format);
  $page
    ->pressButton('edit-submit');
  $this
    ->assertSession()
    ->statusCodeEquals(200);
  $this
    ->assertSession()
    ->fieldValueEquals('edit-title-0-value', $title);
  $this
    ->assertSession()
    ->fieldValueEquals('edit-bibcite-year-0-value', $year);
}