You are here

public function CsvParserTest::setUp in Feeds 8.3

Same name in this branch
  1. 8.3 tests/src/Unit/Feeds/Parser/CsvParserTest.php \Drupal\Tests\feeds\Unit\Feeds\Parser\CsvParserTest::setUp()
  2. 8.3 tests/src/Kernel/Feeds/Parser/CsvParserTest.php \Drupal\Tests\feeds\Kernel\Feeds\Parser\CsvParserTest::setUp()

Overrides FeedsUnitTestCase::setUp

File

tests/src/Unit/Feeds/Parser/CsvParserTest.php, line 51

Class

CsvParserTest
@coversDefaultClass \Drupal\feeds\Feeds\Parser\CsvParser @group feeds

Namespace

Drupal\Tests\feeds\Unit\Feeds\Parser

Code

public function setUp() {
  parent::setUp();
  $this->feedType = $this
    ->createMock(FeedTypeInterface::class);
  $configuration = [
    'feed_type' => $this->feedType,
    'line_limit' => 3,
  ];
  $this->parser = new CsvParser($configuration, 'csv', []);
  $this->parser
    ->setStringTranslation($this
    ->getStringTranslationStub());
  $this->state = new State();
  $this->feed = $this
    ->createMock(FeedInterface::class);
  $this->feed
    ->expects($this
    ->any())
    ->method('getType')
    ->will($this
    ->returnValue($this->feedType));
}