You are here

private function PublicationDateTest::_getPubdateFieldValue in Publication Date 8

Returns the value of our published-at field

Return value

string

1 call to PublicationDateTest::_getPubdateFieldValue()
PublicationDateTest::testActionSavingOnForms in src/Tests/PublicationDateTest.php
Test automatic saving of variables via forms

File

src/Tests/PublicationDateTest.php, line 207
Contains \Drupal\publication_date\Tests\PublicationDateTest.

Class

PublicationDateTest
Tests for publication_date.

Namespace

Drupal\publication_date\Tests

Code

private function _getPubdateFieldValue() {
  $value = '';
  if ($this
    ->assertField('pubdate', t('Published At field exists'))) {
    $field = $this
      ->xpath('//input[@id="edit-pubdate"]');
    $value = (string) $field[0]['value'];
    return $value;
  }
  return $value;
}