function ConfigTest::testIsNew

Same name in other branches
  1. 9 core/tests/Drupal/Tests/Core/Config/ConfigTest.php \Drupal\Tests\Core\Config\ConfigTest::testIsNew()
  2. 8.9.x core/tests/Drupal/Tests/Core/Config/ConfigTest.php \Drupal\Tests\Core\Config\ConfigTest::testIsNew()
  3. 11.x core/tests/Drupal/Tests/Core/Config/ConfigTest.php \Drupal\Tests\Core\Config\ConfigTest::testIsNew()

@covers ::isNew

File

core/tests/Drupal/Tests/Core/Config/ConfigTest.php, line 113

Class

ConfigTest
Tests the Config.

Namespace

Drupal\Tests\Core\Config

Code

public function testIsNew() : void {
    // Config should be new by default.
    $this->assertTrue($this->config
        ->isNew());
    // Config is no longer new once saved.
    $this->config
        ->save();
    $this->assertFalse($this->config
        ->isNew());
}

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