diff --git a/core/tests/Drupal/Tests/Core/Entity/EntityManagerTest.php b/core/tests/Drupal/Tests/Core/Entity/EntityManagerTest.php index a750c12..1788e5a 100644 --- a/core/tests/Drupal/Tests/Core/Entity/EntityManagerTest.php +++ b/core/tests/Drupal/Tests/Core/Entity/EntityManagerTest.php @@ -553,7 +553,7 @@ public function testGetBaseFieldDefinitionsInvalidDefinition() { } /** - * Tests the getFieldDefinitions() method. + * Tests that getFieldDefinitions() method sets the 'provider' definition key. * * @covers ::getFieldDefinitions() */ diff --git a/core/tests/Drupal/Tests/Core/Entity/FieldDefinitionTest.php b/core/tests/Drupal/Tests/Core/Entity/FieldDefinitionTest.php index 309d99a..785f3b5 100644 --- a/core/tests/Drupal/Tests/Core/Entity/FieldDefinitionTest.php +++ b/core/tests/Drupal/Tests/Core/Entity/FieldDefinitionTest.php @@ -202,4 +202,26 @@ public function testFieldConfigurable() { $this->assertFalse($definition->isConfigurable()); } + /** + * Tests provider. + */ + public function testFieldProvider() { + $definition = FieldDefinition::create($this->fieldType); + $provider = $this->randomName(); + $definition->setProvider($provider); + $this->assertEquals($provider, $definition->getProvider()); + } + + /** + * Tests custom storage. + */ + public function testCustomStorage() { + $definition = FieldDefinition::create($this->fieldType); + $this->assertFalse($definition->hasCustomStorage()); + $definition->setCustomStorage(TRUE); + $this->assertTrue($definition->hasCustomStorage()); + $definition->setCustomStorage(FALSE); + $this->assertFalse($definition->hasCustomStorage()); + } + }