You are here

protected function UtilityTest::setUp in Search API 8

Overrides UnitTestCase::setUp

File

tests/src/Unit/UtilityTest.php, line 23

Class

UtilityTest
Tests the Search API utility class.

Namespace

Drupal\Tests\search_api\Unit

Code

protected function setUp() {
  parent::setUp();
  $container = new ContainerBuilder();
  $config_factory = $this
    ->createMock(ConfigFactoryInterface::class);
  $config = $this
    ->createMock(ImmutableConfig::class);
  $config
    ->method('get')
    ->willReturn(NULL);
  $config_factory
    ->method('get')
    ->willReturnMap([
    [
      'search_api.settings',
      $config,
    ],
  ]);
  $container
    ->set('config.factory', $config_factory);
  \Drupal::setContainer($container);
}