You are here

public function SettingsTest::testGet in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/tests/Drupal/Tests/Core/Site/SettingsTest.php \Drupal\Tests\Core\Site\SettingsTest::testGet()

@covers ::get

File

core/tests/Drupal/Tests/Core/Site/SettingsTest.php, line 48
Contains \Drupal\Tests\Core\Site\SettingsTest.

Class

SettingsTest
@coversDefaultClass \Drupal\Core\Site\Settings @group Site

Namespace

Drupal\Tests\Core\Site

Code

public function testGet() {

  // Test stored settings.
  $this
    ->assertEquals($this->config['one'], Settings::get('one'), 'The correct setting was not returned.');
  $this
    ->assertEquals($this->config['two'], Settings::get('two'), 'The correct setting was not returned.');

  // Test setting that isn't stored with default.
  $this
    ->assertEquals('3', Settings::get('three', '3'), 'Default value for a setting not properly returned.');
  $this
    ->assertNull(Settings::get('four'), 'Non-null value returned for a setting that should not exist.');
}