You are here

protected function ContentEntityAutosaveFormTestBase::makeEntityFormChange in Autosave Form 8

Makes a change by the given change/step ID.

Parameters

$change_id: The change id of the change to make.

3 calls to ContentEntityAutosaveFormTestBase::makeEntityFormChange()
ContentEntityAutosaveFormTestBase::doTestAutosaveStatesPurgingOnConfigEvent in tests/src/FunctionalJavascript/ContentEntity/ContentEntityAutosaveFormTestBase.php
Tests that autosave states are purged on modifying a form related config.
ContentEntityAutosaveFormTestBase::doTestConcurrentEditing in tests/src/FunctionalJavascript/ContentEntity/ContentEntityAutosaveFormTestBase.php
Tests concurrent editing.
ContentEntityAutosaveFormTestBase::makeAllEntityFormChanges in tests/src/FunctionalJavascript/ContentEntity/ContentEntityAutosaveFormTestBase.php
Executes all change steps.

File

tests/src/FunctionalJavascript/ContentEntity/ContentEntityAutosaveFormTestBase.php, line 404

Class

ContentEntityAutosaveFormTestBase
Base test class for testing autosave support for entity forms.

Namespace

Drupal\Tests\autosave_form\FunctionalJavascript\ContentEntity

Code

protected function makeEntityFormChange($change_id) {
  $this
    ->logHtmlOutput(__FUNCTION__ . ' before change ' . $change_id);
  switch ($change_id) {
    case 1:

      // Alter the title field.
      $this
        ->alterTitleField();
      break;
    case 2:

      // Fill the first item of the test field and assert that a new autosave
      // entry has been created.
      $this
        ->fillTestField($this->unlimitedCardinalityField, 0, 'delta 0');
      break;
    case 3:

      // Add new item to the test field and assert that a new autosave entry has
      // been created.
      $new_delta_expected = 1;
      $this
        ->addItemToUnlimitedTestField($new_delta_expected);
      break;
    case 4:

      // Fill the new item of the test field and assert that a new autosave
      // entry has been created.
      $field_delta = 1;
      $this
        ->fillTestField($this->unlimitedCardinalityField, $field_delta, 'delta 1');
      break;
    case 5:

      // Fill the required test field.
      $this
        ->fillTestField($this->requiredField, 0, 'required test field');
      break;
  }
  $this
    ->logHtmlOutput(__FUNCTION__ . ' after change ' . $change_id);
}