You are here

public function DurationFieldBrowserTestBase::assertTextValue in Duration Field 8

Same name and namespace in other branches
  1. 8.2 tests/src/Functional/DurationFieldBrowserTestBase.php \Drupal\Tests\duration_field\Functional\DurationFieldBrowserTestBase::assertTextValue()
  2. 3.0.x tests/src/Functional/DurationFieldBrowserTestBase.php \Drupal\Tests\duration_field\Functional\DurationFieldBrowserTestBase::assertTextValue()

Asserts that the value submitted in a text field is correct.

File

tests/src/Functional/DurationFieldBrowserTestBase.php, line 105

Class

DurationFieldBrowserTestBase
Base class that provides some helper functions for functional tests.

Namespace

Drupal\Tests\duration_field\Functional

Code

public function assertTextValue($htmlID, $value) {
  if (preg_match('/^#/', $htmlID)) {
    $htmlID = substr($htmlID, 1);
  }
  $this
    ->assertSession()
    ->fieldValueEquals($htmlID, $value);
}