You are here

protected function EmbeddedScheduledUpdateTypeTestBase::checkNewFieldRequired in Scheduled Updates 8

Parameters

array $edit:

string $add_url:

string $reference_field_label:

string $reference_field_name:

Return value

array

Throws

\Behat\Mink\Exception\ResponseTextException

2 calls to EmbeddedScheduledUpdateTypeTestBase::checkNewFieldRequired()
AddFieldScheduledUpdateTypeTest::checkAddUpdateField in tests/src/FunctionalJavascript/AddFieldScheduledUpdateTypeTest.php
Test to check from manage fields on Node.
EmbeddedScheduledUpdateTypeTest::createType in tests/src/FunctionalJavascript/EmbeddedScheduledUpdateTypeTest.php
Create a scheduled update type via the UI.

File

tests/src/FunctionalJavascript/EmbeddedScheduledUpdateTypeTestBase.php, line 130
Contains \Drupal\Tests\scheduled_updates\EmbeddedScheduledUpdateTypeTestBase.

Class

EmbeddedScheduledUpdateTypeTestBase
Base test class for embedded update types.

Namespace

Drupal\Tests\scheduled_updates\FunctionalJavascript

Code

protected function checkNewFieldRequired(array &$edit, $add_url, $reference_field_label, $reference_field_name) {

  // Save first without new field information.
  // This is only enforce by javascript states,
  // @see \Drupal\scheduled_updates\Form\ScheduledUpdateTypeBaseForm::validateForm
  $page = $this
    ->getSession()
    ->getPage();

  // Remove label explicitly.
  $page
    ->fillField('reference_settings[new_field][label]', '');

  //$page->fillField('reference_settings[new_field][field_name]', '');
  $page
    ->pressButton('Save');
  $this
    ->assertUrl($add_url);
  $edit['reference_settings[new_field][label]'] = $reference_field_label;
  return $edit;
}