diff --git a/core/lib/Drupal/Core/Entity/Display/EntityDisplayInterface.php b/core/lib/Drupal/Core/Entity/Display/EntityDisplayInterface.php index 0381cdc..9733112 100644 --- a/core/lib/Drupal/Core/Entity/Display/EntityDisplayInterface.php +++ b/core/lib/Drupal/Core/Entity/Display/EntityDisplayInterface.php @@ -92,7 +92,7 @@ public function getHighestWeight(); public function getRenderer($field_name); /** - * Returns the entity type this display mode is used for. + * Returns the entity type for which this display mode is used. * * @return string * The entity type id. @@ -100,24 +100,21 @@ public function getRenderer($field_name); public function getTargetEntityTypeId(); /** - * Return the view or form mode to be displayed. + * Returns the view or form mode to be displayed. * * @return string */ public function getMode(); /** - * Return the original view or form mode that was requested. - * - * Case of view/form modes being configured to fall back to the 'default' - * display). + * Returns the original view or form mode that was requested. * * @return string */ public function getOriginalMode(); /** - * Gets the bundle to be displayed. + * Returns the bundle to be displayed. * * @return string * The bundle to be displayed. diff --git a/core/tests/Drupal/Tests/Core/Config/Entity/EntityDisplayBaseTest.php b/core/tests/Drupal/Tests/Core/Config/Entity/EntityDisplayBaseTest.php index 96ffbf7..350ed0b 100644 --- a/core/tests/Drupal/Tests/Core/Config/Entity/EntityDisplayBaseTest.php +++ b/core/tests/Drupal/Tests/Core/Config/Entity/EntityDisplayBaseTest.php @@ -60,4 +60,16 @@ public function testGetDisplayBundle() { $this->assertEquals('test', $mock->getDisplayBundle()); } + /** + * @covers ::setDisplayBundle() + */ + public function testSetDisplayBundle() { + $mock = $this->getMockForAbstractClass('\Drupal\Core\Entity\EntityDisplayBase', array(), '', FALSE); + $reflection = new \ReflectionProperty($mock, 'bundle'); + $reflection->setAccessible(TRUE); + $mock->setDisplayBundle('test'); + $reflection->setValue($mock, 'test'); + $this->assertEquals('test', $reflection->getValue($mock)); + } + }