function FieldStorageGetPropertyDefinitionTest::testFieldStorageConfigGetPropertyDefinitionWithNull

Tests FieldStorageConfig::getPropertyDefinition() with null.

Attributes

#[IgnoreDeprecations]

File

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

Class

FieldStorageGetPropertyDefinitionTest
Tests getting property definitions from field storages.

Namespace

Drupal\KernelTests\Core\Field

Code

public function testFieldStorageConfigGetPropertyDefinitionWithNull() : void {
  $this->expectDeprecation('Calling Drupal\\field\\Entity\\FieldStorageConfig::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(FieldStorageConfig::create([
    'field_name' => 'test_field',
    'entity_type' => 'entity_test',
    'type' => 'test_field',
  ])->getPropertyDefinition(NULL));
}

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