function NullDescriptionTest::testRunUpdates

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

Tests the upgrade path for updating empty description to NULL.

File

core/modules/taxonomy/tests/src/Functional/Update/NullDescriptionTest.php, line 31

Class

NullDescriptionTest
Tests the upgrade path for making vocabularies' description NULL.

Namespace

Drupal\Tests\taxonomy\Functional\Update

Code

public function testRunUpdates() : void {
    $vocabulary = Vocabulary::load('tags');
    $this->assertInstanceOf(Vocabulary::class, $vocabulary);
    $this->assertSame("\n", $vocabulary->get('description'));
    $this->runUpdates();
    $vocabulary = Vocabulary::load('tags');
    $this->assertInstanceOf(Vocabulary::class, $vocabulary);
    $this->assertNull($vocabulary->get('description'));
    $this->assertSame('', $vocabulary->getDescription());
}

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