function BlockValidationTest::testWeightCannotBeNull

@group legacy

File

core/modules/block/tests/src/Kernel/BlockValidationTest.php, line 176

Class

BlockValidationTest
Tests validation of block entities.

Namespace

Drupal\Tests\block\Kernel

Code

public function testWeightCannotBeNull() : void {
    $this->entity
        ->set('weight', NULL);
    $this->assertNull($this->entity
        ->getWeight());
    $this->expectDeprecation('Saving a block with a non-integer weight is deprecated in drupal:11.1.0 and removed in drupal:12.0.0. See https://www.drupal.org/node/3462474');
    $this->entity
        ->save();
}

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