You are here

protected function EntityStatusTest::setUp in Search API 8

Creates a new processor object for use in the tests.

Overrides UnitTestCase::setUp

File

tests/src/Unit/Processor/EntityStatusTest.php, line 54

Class

EntityStatusTest
Tests the "Entity status" processor.

Namespace

Drupal\Tests\search_api\Unit\Processor

Code

protected function setUp() {
  parent::setUp();
  $this
    ->setUpMockContainer();
  $this->processor = new EntityStatus([], 'entity_status', []);
  $this->index = $this
    ->createMock(IndexInterface::class);
  foreach ([
    'node',
    'comment',
    'user',
    'file',
  ] as $entity_type) {
    $datasource = $this
      ->createMock(DatasourceInterface::class);
    $datasource
      ->expects($this
      ->any())
      ->method('getEntityTypeId')
      ->will($this
      ->returnValue($entity_type));
    $this->datasources["entity:{$entity_type}"] = $datasource;
  }
}