public function ContentEntityNormalizerTest::createMockForContentHubEntityConfig in Acquia Content Hub 8
Returns a fake ContentHubEntityConfig object.
Return value
\Drupal\Core\Config\ImmutableConfig The fake config.
1 call to ContentEntityNormalizerTest::createMockForContentHubEntityConfig()
- ContentEntityNormalizerTest::setUp in tests/
src/ Unit/ Normalizer/ ContentEntityNormalizerTest.php
File
- tests/
src/ Unit/ Normalizer/ ContentEntityNormalizerTest.php, line 947
Class
- ContentEntityNormalizerTest
- PHPUnit test for the ContentEntityNormalizer class.
Namespace
Drupal\Tests\acquia_contenthub\Unit\NormalizerCode
public 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;
}