You are here

public function ConfigEntityBaseUnitTest::testIsNew in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 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 334
Contains \Drupal\Tests\Core\Config\Entity\ConfigEntityBaseUnitTest.

Class

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

Namespace

Drupal\Tests\Core\Config\Entity

Code

public function testIsNew() {
  $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());
}