You are here

public function FieldInputValueNormalizerTraitTest::testScalarWithNoMainProperty in Drupal 8

Same name and namespace in other branches
  1. 9 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 86

Class

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

Namespace

Drupal\Tests\Core\Field

Code

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