本文整理汇总了PHP中Drupal\Core\DrupalKernel::discoverServiceProviders方法的典型用法代码示例。如果您正苦于以下问题:PHP DrupalKernel::discoverServiceProviders方法的具体用法?PHP DrupalKernel::discoverServiceProviders怎么用?PHP DrupalKernel::discoverServiceProviders使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Drupal\Core\DrupalKernel
的用法示例。
在下文中一共展示了DrupalKernel::discoverServiceProviders方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: discoverServiceProviders
/**
* {@inheritdoc}
*/
public function discoverServiceProviders()
{
parent::discoverServiceProviders();
// The test runner does not require an installed Drupal site to exist.
// Therefore, its environment is identical to that of the early installer.
$this->serviceProviderClasses['app']['Test'] = 'Drupal\\Core\\Installer\\InstallerServiceProvider';
}
示例2: testDiscoverServiceNoContainerYamls
/**
* Tests the exception when container_yamls is not set.
*/
public function testDiscoverServiceNoContainerYamls()
{
new Settings([]);
$kernel = new DrupalKernel('prod', new \Composer\Autoload\ClassLoader());
$kernel->discoverServiceProviders();
$expect = ['app' => ['core' => 'core/core.services.yml'], 'site' => []];
$this->assertAttributeSame($expect, 'serviceYamls', $kernel);
}
示例3: testDiscoverServiceNoContainerYamls
/**
* Tests the exception when container_yamls is not set.
*
* @covers ::discoverServiceProviders
* @expectedException \Exception
*/
public function testDiscoverServiceNoContainerYamls()
{
new Settings([]);
$kernel = new DrupalKernel('prod', new \Composer\Autoload\ClassLoader());
$kernel->discoverServiceProviders();
}