function FieldInputValueNormalizerTraitTest::testScalarWithNoMainProperty

Same name in other branches
  1. 9 core/tests/Drupal/Tests/Core/Field/FieldInputValueNormalizerTraitTest.php \Drupal\Tests\Core\Field\FieldInputValueNormalizerTraitTest::testScalarWithNoMainProperty()
  2. 8.9.x core/tests/Drupal/Tests/Core/Field/FieldInputValueNormalizerTraitTest.php \Drupal\Tests\Core\Field\FieldInputValueNormalizerTraitTest::testScalarWithNoMainProperty()
  3. 11.x core/tests/Drupal/Tests/Core/Field/FieldInputValueNormalizerTraitTest.php \Drupal\Tests\Core\Field\FieldInputValueNormalizerTraitTest::testScalarWithNoMainProperty()

@covers ::normalizeValue

File

core/tests/Drupal/Tests/Core/Field/FieldInputValueNormalizerTraitTest.php, line 88

Class

FieldInputValueNormalizerTraitTest
@coversDefaultClass \Drupal\Core\Field\FieldInputValueNormalizerTrait @group Field

Namespace

Drupal\Tests\Core\Field

Code

public function testScalarWithNoMainProperty() : void {
    $this->expectException(\InvalidArgumentException::class);
    $this->expectExceptionMessage('A main property is required when normalizing scalar field values.');
    $value = 'foo';
    $this->normalizeValue($value, NULL);
}

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