You are here

protected function UniqueFieldAjaxBase::getSaveMethod in Unique field ajax 2.x

Helper method to return the saving method of add or edit.

Parameters

string|null $id: Node id.

Return value

string Method path.

2 calls to UniqueFieldAjaxBase::getSaveMethod()
UniqueFieldAjaxBase::itCannotSaveField in tests/src/Functional/UniqueFieldAjaxBase.php
Runs a test to see if a field cannot be saved.
UniqueFieldAjaxBase::itCanSaveField in tests/src/Functional/UniqueFieldAjaxBase.php
Runs a test to see if a field can be saved.

File

tests/src/Functional/UniqueFieldAjaxBase.php, line 321

Class

UniqueFieldAjaxBase
The base testing class for unique_field_ajax.

Namespace

Drupal\Tests\unique_field_ajax\Functional

Code

protected function getSaveMethod(string $id = NULL) : string {
  return !$id ? 'node/add/' . $this->contentTypeName : 'node/' . $id . '/edit';
}