function FieldStorageGetPropertyDefinitionTest::testBaseFieldGetPropertyDefinitionWithNull

Tests BaseFieldDefinition::getPropertyDefinition() with null.

Attributes

#[IgnoreDeprecations]

File

core/tests/Drupal/KernelTests/Core/Field/FieldStorageGetPropertyDefinitionTest.php, line 43

Class

FieldStorageGetPropertyDefinitionTest
Tests getting property definitions from field storages.

Namespace

Drupal\KernelTests\Core\Field

Code

public function testBaseFieldGetPropertyDefinitionWithNull() : void {
  $this->expectDeprecation('Calling Drupal\\Core\\Field\\BaseFieldDefinition::getPropertyDefinition() with a non-string $name is deprecated in drupal:11.3.0 and throws an exception in drupal:12.0.0. See https://www.drupal.org/node/3557373');
  $this->assertNull(BaseFieldDefinition::create('string')->getPropertyDefinition(NULL));
}

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