public function SettingsTest::testGetInstanceReflection in Drupal 8
Same name and namespace in other branches
- 9 core/tests/Drupal/Tests/Core/Site/SettingsTest.php \Drupal\Tests\Core\Site\SettingsTest::testGetInstanceReflection()
- 10 core/tests/Drupal/Tests/Core/Site/SettingsTest.php \Drupal\Tests\Core\Site\SettingsTest::testGetInstanceReflection()
Tests that an exception is thrown when settings are not initialized yet.
@covers ::getInstance
File
- core/
tests/ Drupal/ Tests/ Core/ Site/ SettingsTest.php, line 142
Class
- SettingsTest
- @coversDefaultClass \Drupal\Core\Site\Settings @group Site
Namespace
Drupal\Tests\Core\SiteCode
public function testGetInstanceReflection() {
$settings = new Settings([]);
$class = new \ReflectionClass(Settings::class);
$instace_property = $class
->getProperty("instance");
$instace_property
->setAccessible(TRUE);
$instace_property
->setValue(NULL);
$this
->expectException(\BadMethodCallException::class);
$settings
->getInstance();
}