diff --git a/core/tests/Drupal/Tests/Core/Site/SettingsGetInstanceTest.php b/core/tests/Drupal/Tests/Core/Site/SettingsGetInstanceTest.php deleted file mode 100644 index 9e82a88..0000000 --- a/core/tests/Drupal/Tests/Core/Site/SettingsGetInstanceTest.php +++ /dev/null @@ -1,36 +0,0 @@ -getInstance(); - $this->assertEquals($singleton, $settings); - } - -} diff --git a/core/tests/Drupal/Tests/Core/Site/SettingsTest.php b/core/tests/Drupal/Tests/Core/Site/SettingsTest.php index c92f676..bf74946 100644 --- a/core/tests/Drupal/Tests/Core/Site/SettingsTest.php +++ b/core/tests/Drupal/Tests/Core/Site/SettingsTest.php @@ -131,4 +131,19 @@ public function testGetApcuPrefix() { $this->assertNotEquals($settings::getApcuPrefix('cache_test', '/test/a'), $settings::getApcuPrefix('cache_test', '/test/b')); } + /** + * @covers ::getInstance + * @expectedException \BadMethodCallException + */ + public function testGetInstanceReflection() { + $settings = new Settings(array()); + + $class = new \ReflectionClass('Drupal\Core\Site\Settings'); + $instace_property = $class->getProperty("instance"); + $instace_property->setAccessible(TRUE); + $instace_property->setValue(NULL); + + $singleton = $settings->getInstance(); + } + }