function FieldStorageCreateCheckDeprecationTest::testFieldStorageCreateCheck

Tests the field storage create check subscriber.

File

core/tests/Drupal/KernelTests/Core/Field/FieldStorageCreateCheckDeprecationTest.php, line 45

Class

FieldStorageCreateCheckDeprecationTest
Tests the field storage create check subscriber.

Namespace

Drupal\KernelTests\Core\Field

Code

public function testFieldStorageCreateCheck() : void {
    $this->expectDeprecation('Creating the "entity_test.field_test" field storage definition without the entity schema "entity_test" being installed is deprecated in drupal:11.2.0 and will be replaced by a LogicException in drupal:12.0.0. See https://www.drupal.org/node/3493981');
    FieldStorageConfig::create([
        'field_name' => 'field_test',
        'entity_type' => 'entity_test',
        'type' => 'integer',
    ])->save();
}

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