You are here

protected function ContentHubExportQueueControllerTest::createMockForContentHubEntityConfig in Acquia Content Hub 8

Returns a fake ContentHubEntityConfig object.

Return value

\Drupal\Core\Config\ImmutableConfig The fake config.

1 call to ContentHubExportQueueControllerTest::createMockForContentHubEntityConfig()
ContentHubExportQueueControllerTest::setUp in tests/src/Unit/Controller/ContentHubExportQueueControllerTest.php

File

tests/src/Unit/Controller/ContentHubExportQueueControllerTest.php, line 200

Class

ContentHubExportQueueControllerTest
PHPUnit test for the ContentHubExportQueueController class.

Namespace

Drupal\Tests\acquia_contenthub\Unit\Controller

Code

protected function createMockForContentHubEntityConfig() {
  $contenthub_entity_config = $this
    ->getMockBuilder('Drupal\\Core\\Config\\ImmutableConfig')
    ->disableOriginalConstructor()
    ->setMethods([
    'get',
  ])
    ->getMockForAbstractClass();
  $contenthub_entity_config
    ->method('get')
    ->willReturnCallback(function ($argument) {
    if (isset($this->configEntity[$argument])) {
      return $this->configEntity[$argument];
    }
    return NULL;
  });
  return $contenthub_entity_config;
}