You are here

public function EntityProcessorBaseTest::setUp in Feeds 8.3

Overrides FeedsKernelTestBase::setUp

File

tests/src/Kernel/Feeds/Processor/EntityProcessorBaseTest.php, line 58

Class

EntityProcessorBaseTest
@coversDefaultClass \Drupal\feeds\Feeds\Processor\EntityProcessorBase @group feeds

Namespace

Drupal\Tests\feeds\Kernel\Feeds\Processor

Code

public function setUp() {
  parent::setUp();
  $this->feedType = $this
    ->createMock(FeedTypeInterface::class);
  $this->feedType
    ->expects($this
    ->any())
    ->method('getMappings')
    ->will($this
    ->returnValue([]));
  $this->processor = $this
    ->getMockForAbstractClass(EntityProcessorBase::class, [
    [
      'values' => [
        'type' => 'article',
      ],
      'feed_type' => $this->feedType,
    ],
    'entity:node',
    [
      'id' => 'entity:node',
      'title' => 'Node',
      'description' => 'Creates nodes from feed items.',
      'entity_type' => 'node',
      'arguments' => [
        '@entity_type.manager',
        '@entity_type.bundle.info',
      ],
      'form' => [
        'configuration' => 'Drupal\\feeds\\Feeds\\Processor\\Form\\DefaultEntityProcessorForm',
        'option' => 'Drupal\\feeds\\Feeds\\Processor\\Form\\EntityProcessorOptionForm',
      ],
      'class' => EntityProcessorBase::class,
      'provider' => 'feeds',
      'plugin_type' => 'processor',
    ],
    \Drupal::service('entity_type.manager'),
    \Drupal::service('entity_type.bundle.info'),
    \Drupal::service('language_manager'),
  ]);
  $this->feed = $this
    ->createMock(FeedInterface::class);
  $this->feed
    ->expects($this
    ->any())
    ->method('id')
    ->will($this
    ->returnValue(1));
  $this->feed
    ->expects($this
    ->any())
    ->method('getState')
    ->with(StateInterface::CLEAN)
    ->will($this
    ->returnValue(new CleanState($this->feed
    ->id())));
  $this->state = new State();

  // Install key/value expire schema.
  $this
    ->installSchema('system', [
    'key_value_expire',
  ]);
}