/**
* Tests CRUD operations.
+ *
+ * @covers \Drupal\Core\Entity\KeyValueStore\KeyValueEntityStorage::hasData
*/
public function testCRUD() {
$default_langcode = \Drupal::languageManager()->getDefaultLanguage()->getId();
+
+ $storage = \Drupal::entityTypeManager()->getStorage('entity_test_label');
+ $this->assertFalse($storage->hasData());
+
// Verify default properties on a newly created empty entity.
$empty = EntityTestLabel::create();
$this->assertIdentical($empty->id->value, NULL);
$this->fail('EntityMalformedException was not thrown.');
}
+ // Verify that hasData() returns the expected result.
+ $this->assertTrue($storage->hasData());
+
// Verify that the correct status is returned and properties did not change.
$this->assertIdentical($status, SAVED_NEW);
$this->assertIdentical($entity_test->id(), $expected['id']);
}
}
+ /**
+ * Tests uninstallation of a module that does not use the SQL entity storage.
+ */
+ public function testUninstall() {
+ $uninstall_validator_reasons = \Drupal::service('content_uninstall_validator')->validate('keyvalue_test');
+ $this->assertEmpty($uninstall_validator_reasons);
+ }
+
}