You are here

public function NodeLegacyTest::testNodeTypeIsNewRevision in Drupal 8

Tests that NodeType::isNewRevision() triggers a deprecation error.

@expectedDeprecation NodeType::isNewRevision is deprecated in drupal:8.3.0 and is removed from drupal:9.0.0. Use Drupal\Core\Entity\RevisionableEntityBundleInterface::shouldCreateNewRevision() instead. See https://www.drupal.org/node/3067365

File

core/modules/node/tests/src/Kernel/NodeLegacyTest.php, line 85

Class

NodeLegacyTest
Tests legacy user functionality.

Namespace

Drupal\Tests\node\Kernel

Code

public function testNodeTypeIsNewRevision() {
  $type = NodeType::load('page');
  $this
    ->assertSame($type
    ->shouldCreateNewRevision(), $type
    ->isNewRevision());
}