You are here

public function TextTest::setUp in Feeds 8.3

Overrides FeedsUnitTestCase::setUp

File

tests/src/Unit/Feeds/Target/TextTest.php, line 37

Class

TextTest
@coversDefaultClass \Drupal\feeds\Feeds\Target\Text @group feeds

Namespace

Drupal\Tests\feeds\Unit\Feeds\Target

Code

public function setUp() {
  parent::setUp();
  $this->filter = $this
    ->prophesize(FilterFormatInterface::class);
  $this->filter
    ->label()
    ->willReturn('Test filter');
  $method = $this
    ->getMethod(Text::class, 'prepareTarget')
    ->getClosure();
  $configuration = [
    'feed_type' => $this
      ->createMock(FeedTypeInterface::class),
    'target_definition' => $method($this
      ->getMockFieldDefinition()),
  ];
  $this->target = $this
    ->getMockBuilder(Text::class)
    ->setConstructorArgs([
    $configuration,
    'text',
    [],
    $this
      ->createMock(AccountInterface::class),
  ])
    ->setMethods([
    'getFilterFormats',
  ])
    ->getMock();
  $this->target
    ->setStringTranslation($this
    ->getStringTranslationStub());
}