public function RegistryTest::testPostProcessExtension in Drupal 8
Same name and namespace in other branches
- 9 core/tests/Drupal/Tests/Core/Theme/RegistryTest.php \Drupal\Tests\Core\Theme\RegistryTest::testPostProcessExtension()
- 10 core/tests/Drupal/Tests/Core/Theme/RegistryTest.php \Drupal\Tests\Core\Theme\RegistryTest::testPostProcessExtension()
@covers ::postProcessExtension @covers ::completeSuggestion @covers ::mergePreprocessFunctions
@dataProvider providerTestPostProcessExtension
Parameters
array $defined_functions: An array of functions to be used in place of get_defined_functions().
array $hooks: An array of theme hooks to process.
array $expected: The expected results.
File
- core/
tests/ Drupal/ Tests/ Core/ Theme/ RegistryTest.php, line 176
Class
- RegistryTest
- @coversDefaultClass \Drupal\Core\Theme\Registry @group Theme
Namespace
Drupal\Tests\Core\ThemeCode
public function testPostProcessExtension($defined_functions, $hooks, $expected) {
static::$functions['user'] = $defined_functions;
$theme = $this
->prophesize(ActiveTheme::class);
$theme
->getBaseThemeExtensions()
->willReturn([]);
$theme
->getName()
->willReturn('test');
$theme
->getEngine()
->willReturn('twig');
$this->moduleHandler
->expects($this
->atLeastOnce())
->method('getModuleList')
->willReturn([]);
$class = new \ReflectionClass(Registry::class);
$reflection_method = $class
->getMethod('postProcessExtension');
$reflection_method
->setAccessible(TRUE);
$reflection_method
->invokeArgs($this->registry, [
&$hooks,
$theme
->reveal(),
]);
$this
->assertArrayEquals($expected, $hooks);
}