You are here

public function FieldUninstallValidatorTest::testValidateNoStorages in Drupal 10

Same name and namespace in other branches
  1. 8 core/modules/field/tests/src/Unit/FieldUninstallValidatorTest.php \Drupal\Tests\field\Unit\FieldUninstallValidatorTest::testValidateNoStorages()
  2. 9 core/modules/field/tests/src/Unit/FieldUninstallValidatorTest.php \Drupal\Tests\field\Unit\FieldUninstallValidatorTest::testValidateNoStorages()

@covers ::validate

File

core/modules/field/tests/src/Unit/FieldUninstallValidatorTest.php, line 40

Class

FieldUninstallValidatorTest
@coversDefaultClass \Drupal\field\FieldUninstallValidator @group field

Namespace

Drupal\Tests\field\Unit

Code

public function testValidateNoStorages() {
  $this->fieldUninstallValidator
    ->expects($this
    ->once())
    ->method('getFieldStoragesByModule')
    ->willReturn([]);
  $module = $this
    ->randomMachineName();
  $expected = [];
  $reasons = $this->fieldUninstallValidator
    ->validate($module);
  $this
    ->assertEquals($expected, $reasons);
}