You are here

public function TestWrapperTarget::getFormStateMock in Feeds Paragraphs 8

Mocks a form state object.

Return value

FormStateInterface The form state.

1 call to TestWrapperTarget::getFormStateMock()
TestWrapperTarget::testBuildConfigurationForm in tests/src/Unit/TestWrapperTarget.php
@covers ::buildConfigurationForm

File

tests/src/Unit/TestWrapperTarget.php, line 37

Class

TestWrapperTarget
@group Feeds Paragraphs @coversDefaultClass \Drupal\feeds_para_mapper\Feeds\Target\WrapperTarget

Namespace

Drupal\Tests\feeds_para_mapper\Unit

Code

public function getFormStateMock() {
  $formState = $this
    ->createMock(FormStateInterface::class);
  $formState
    ->expects($this
    ->any())
    ->method('getTriggeringElement')
    ->willReturn(array(
    '#delta' => 0,
  ));
  $formState
    ->expects($this
    ->any())
    ->method('getValue')
    ->willReturn(array(
    'format' => 'test format',
  ));
  return $formState;
}