function ViewValidationTest::testLabelsAreRequired

@group legacy

File

core/modules/views/tests/src/Kernel/Entity/ViewValidationTest.php, line 40

Class

ViewValidationTest
Tests validation of view entities.

Namespace

Drupal\Tests\views\Kernel\Entity

Code

public function testLabelsAreRequired() : void {
    $this->entity
        ->set('label', NULL);
    $this->expectDeprecation('Saving a view without an explicit label is deprecated in drupal:10.2.0 and will raise an error in drupal:11.0.0. See https://www.drupal.org/node/3381669');
    $this->assertSame($this->entity
        ->id(), $this->entity
        ->label());
}

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