function EntityMaskTest::testIsNew

Same name in other branches
  1. 8.x-3.x modules/ctools_entity_mask/tests/src/Kernel/EntityMaskTest.php \Drupal\Tests\ctools_entity_mask\Kernel\EntityMaskTest::testIsNew()

Tests that mask entities' isNew() method behaves consistently.

File

modules/ctools_entity_mask/tests/src/Kernel/EntityMaskTest.php, line 165

Class

EntityMaskTest
Basic test of entity type masking.

Namespace

Drupal\Tests\ctools_entity_mask\Kernel

Code

public function testIsNew() {
    $block = BlockContent::create([
        'type' => 'basic',
    ]);
    $this->assertTrue($block->isNew());
    $block->save();
    $this->assertFalse($block->isNew());
}