function ConfigEntityBaseUnitTest::testIsNew

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

@covers ::isNew

File

core/tests/Drupal/Tests/Core/Config/Entity/ConfigEntityBaseUnitTest.php, line 416

Class

ConfigEntityBaseUnitTest
@coversDefaultClass \Drupal\Core\Config\Entity\ConfigEntityBase @group Config

Namespace

Drupal\Tests\Core\Config\Entity

Code

public function testIsNew() : void {
    $this->assertFalse($this->entity
        ->isNew());
    $this->assertSame($this->entity, $this->entity
        ->enforceIsNew());
    $this->assertTrue($this->entity
        ->isNew());
    $this->entity
        ->enforceIsNew(FALSE);
    $this->assertFalse($this->entity
        ->isNew());
}

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