コード例 #1
0
ファイル: LayoutTest.php プロジェクト: pulibrary/recap
 /**
  * Tests layout theme implementations.
  *
  * @covers ::getThemeImplementations
  */
 public function testGetThemeImplementations()
 {
     /** @var LayoutPluginManagerInterface|\PHPUnit_Framework_MockObject_MockBuilder $layout_plugin */
     $layout_plugin = $this->getMock('Drupal\\layout_plugin\\Plugin\\Layout\\LayoutPluginManagerInterface');
     $layout_plugin->method('getDefinitions')->willReturn(['simple_layout' => ['path' => 'modules/layout_plugin_test', 'template_path' => 'modules/layout_plugin_test/templates', 'template' => 'simple-layout', 'theme' => 'simple_layout'], 'complex_layout' => ['path' => 'modules/layout_plugin_test', 'theme' => 'complex_layout']]);
     $theme_registry = Layout::getThemeImplementations($layout_plugin);
     $this->assertEquals(['simple_layout' => ['render element' => 'content', 'template' => 'simple-layout', 'path' => 'modules/layout_plugin_test/templates']], $theme_registry);
 }