Unverified Commit 5d1589b8 authored by alexpott's avatar alexpott
Browse files

Issue #3028319 by amateescu: Specialized entity interfaces should extend the main EntityInterface

parent a3a8e460
......@@ -12,9 +12,9 @@
* entity types implementing this interface in order to disallow concurrent
* editing.
*
* @see Drupal\Core\Entity\Plugin\Validation\Constraint\EntityChangedConstraint
* @see \Drupal\Core\Entity\Plugin\Validation\Constraint\EntityChangedConstraint
*/
interface EntityChangedInterface {
interface EntityChangedInterface extends EntityInterface {
/**
* Gets the timestamp of the last entity change for the current translation.
......
......@@ -5,7 +5,7 @@
/**
* Defines the interface for entities that have a description.
*/
interface EntityDescriptionInterface {
interface EntityDescriptionInterface extends EntityInterface {
/**
* Gets the entity description.
......
......@@ -5,7 +5,7 @@
/**
* Provides an interface for access to an entity's published state.
*/
interface EntityPublishedInterface {
interface EntityPublishedInterface extends EntityInterface {
/**
* Returns whether or not the entity is published.
......
......@@ -20,7 +20,7 @@
* @see https://www.drupal.org/docs/8/api/entity-api/structure-of-an-entity-annotation
* @see https://www.drupal.org/docs/8/api/entity-api/making-an-entity-revisionable
*/
interface RevisionableInterface {
interface RevisionableInterface extends EntityInterface {
/**
* Determines whether a new revision should be created on save.
......
......@@ -5,7 +5,7 @@
/**
* A storage that supports revisionable entity types.
*/
interface RevisionableStorageInterface {
interface RevisionableStorageInterface extends EntityStorageInterface {
/**
* Creates a new revision starting off from the specified entity object.
......
......@@ -5,7 +5,7 @@
/**
* Defines methods for an entity that supports synchronization.
*/
interface SynchronizableInterface {
interface SynchronizableInterface extends EntityInterface {
/**
* Sets the status of the synchronization flag.
......
......@@ -7,7 +7,7 @@
/**
* Provides methods for an entity to support translation.
*/
interface TranslatableInterface extends TranslatableDataInterface {
interface TranslatableInterface extends TranslatableDataInterface, EntityInterface {
/**
* Determines if the current translation of the entity has unsaved changes.
......
......@@ -5,7 +5,7 @@
/**
* A storage that supports translatable entity types.
*/
interface TranslatableStorageInterface {
interface TranslatableStorageInterface extends EntityStorageInterface {
/**
* Constructs a new entity translation object, without permanently saving it.
......
......@@ -67,8 +67,7 @@ protected function setUp() {
public function testGetEntityDestinationValues() {
$destination = $this->getEntityRevisionDestination([]);
// Return a dummy because we don't care what gets called.
$entity = $this->prophesize('\Drupal\Core\Entity\EntityInterface')
->willImplement('\Drupal\Core\Entity\RevisionableInterface');
$entity = $this->prophesize('\Drupal\Core\Entity\RevisionableInterface');
// Assert that the first ID from the destination values is used to load the
// entity.
$this->storage->loadRevision(12)
......@@ -85,8 +84,7 @@ public function testGetEntityDestinationValues() {
*/
public function testGetEntityUpdateRevision() {
$destination = $this->getEntityRevisionDestination([]);
$entity = $this->prophesize('\Drupal\Core\Entity\EntityInterface')
->willImplement('\Drupal\Core\Entity\RevisionableInterface');
$entity = $this->prophesize('\Drupal\Core\Entity\RevisionableInterface');
$entity_type = $this->prophesize('\Drupal\Core\Entity\EntityTypeInterface');
$entity_type->getKey('id')->willReturn('nid');
......@@ -113,8 +111,7 @@ public function testGetEntityUpdateRevision() {
*/
public function testGetEntityNewRevision() {
$destination = $this->getEntityRevisionDestination([]);
$entity = $this->prophesize('\Drupal\Core\Entity\EntityInterface')
->willImplement('\Drupal\Core\Entity\RevisionableInterface');
$entity = $this->prophesize('\Drupal\Core\Entity\RevisionableInterface');
$entity_type = $this->prophesize('\Drupal\Core\Entity\EntityTypeInterface');
$entity_type->getKey('id')->willReturn('nid');
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment