You are here

private function LinkitDialogTest::assertEmptyWithJs in Linkit 8.5

Asserts that a variable is empty.

Parameters

string $field_name: The name of the field.

1 call to LinkitDialogTest::assertEmptyWithJs()
LinkitDialogTest::testLinkDialog in tests/src/FunctionalJavascript/LinkitDialogTest.php
Test the link dialog.

File

tests/src/FunctionalJavascript/LinkitDialogTest.php, line 281

Class

LinkitDialogTest
Tests the linkit alterations on the drupallink plugin.

Namespace

Drupal\Tests\linkit\FunctionalJavascript

Code

private function assertEmptyWithJs($field_name) {
  $javascript = "(function (){ return jQuery('input[name=\"" . $field_name . "\"]').val(); })()";
  $field_value = $this
    ->getSession()
    ->evaluateScript($javascript);
  $this
    ->assertEmpty($field_value, 'The "' . $field_name . '" field is empty.');
}