function SystemDateSettingsUpdateTest::testUpdate

Tests update of system.date:country.default & system.date:country.default.

File

core/modules/system/tests/src/Functional/Update/SystemDateSettingsUpdateTest.php, line 34

Class

SystemDateSettingsUpdateTest
Tests system.date:country.default and system.date:timezone.default values.

Namespace

Drupal\Tests\system\Functional\Update

Code

public function testUpdate() : void {
    // Replace the 'Australia/Sydney' time zone with an empty string, set
    // previously in \Drupal\Core\Test\FunctionalTestSetupTrait::initConfig().
    $this->config('system.date')
        ->set('timezone.default', '')
        ->save();
    $config_before = $this->config('system.date');
    $this->assertSame('', $config_before->get('country.default'));
    $this->assertSame('', $config_before->get('timezone.default'));
    $this->runUpdates();
    $config_after = $this->config('system.date');
    $this->assertNull($config_after->get('country.default'));
    $this->assertNull($config_after->get('timezone.default'));
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.