function NullHelpAndDescriptionTest::testRunUpdates

Same name in other branches
  1. 11.x core/modules/node/tests/src/Functional/Update/NullHelpAndDescriptionTest.php \Drupal\Tests\node\Functional\Update\NullHelpAndDescriptionTest::testRunUpdates()

Tests the upgrade path for updating empty help and description to NULL.

File

core/modules/node/tests/src/Functional/Update/NullHelpAndDescriptionTest.php, line 30

Class

NullHelpAndDescriptionTest
Tests the upgrade path for making content types' help and description NULL.

Namespace

Drupal\Tests\node\Functional\Update

Code

public function testRunUpdates() : void {
    $node_type = NodeType::load('article');
    $this->assertInstanceOf(NodeType::class, $node_type);
    $this->assertSame('', $node_type->get('help'));
    $this->assertSame("\n", $node_type->get('description'));
    $this->runUpdates();
    $node_type = NodeType::load('article');
    $this->assertInstanceOf(NodeType::class, $node_type);
    $this->assertNull($node_type->get('help'));
    $this->assertNull($node_type->get('description'));
    $this->assertSame('', $node_type->getHelp());
    $this->assertSame('', $node_type->getDescription());
}

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