You are here

public function ConfigTest::testIsNew in Drupal 8

Same name and namespace in other branches
  1. 9 core/tests/Drupal/Tests/Core/Config/ConfigTest.php \Drupal\Tests\Core\Config\ConfigTest::testIsNew()
  2. 10 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 107

Class

ConfigTest
Tests the Config.

Namespace

Drupal\Tests\Core\Config

Code

public function testIsNew() {

  // 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());
}