diff --git a/core/lib/Drupal/Core/Entity/Display/EntityDisplayInterface.php b/core/lib/Drupal/Core/Entity/Display/EntityDisplayInterface.php index 50279e1..0381cdc 100644 --- a/core/lib/Drupal/Core/Entity/Display/EntityDisplayInterface.php +++ b/core/lib/Drupal/Core/Entity/Display/EntityDisplayInterface.php @@ -107,8 +107,10 @@ public function getTargetEntityTypeId(); 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). + * Return the original view or form mode that was requested. + * + * Case of view/form modes being configured to fall back to the 'default' + * display). * * @return string */ diff --git a/core/tests/Drupal/Tests/Core/Config/Entity/EntityDisplayBaseTest.php b/core/tests/Drupal/Tests/Core/Config/Entity/EntityDisplayBaseTest.php index 14256c8..96ffbf7 100644 --- a/core/tests/Drupal/Tests/Core/Config/Entity/EntityDisplayBaseTest.php +++ b/core/tests/Drupal/Tests/Core/Config/Entity/EntityDisplayBaseTest.php @@ -12,7 +12,6 @@ /** * @coversDefaultClass \Drupal\entity\EntityDisplayBase * - * @group Drupal * @group Config */ class EntityDisplayBaseTest extends UnitTestCase { @@ -21,38 +20,44 @@ class EntityDisplayBaseTest extends UnitTestCase { * @covers ::getTargetEntityTypeId() */ public function testGetTargetEntityTypeId() { - $display = $this->getMockForAbstractClass('\Drupal\Core\Entity\EntityDisplayBase', array(), '', FALSE); - $display->set('targetEntityType', 'test'); - $this->assertEquals('test', $display->getTargetEntityTypeId()); + $mock = $this->getMockForAbstractClass('\Drupal\Core\Entity\EntityDisplayBase', array(), '', FALSE); + $reflection = new \ReflectionProperty($mock, 'targetEntityType'); + $reflection->setAccessible(TRUE); + $reflection->setValue($mock, 'test'); + $this->assertEquals('test', $mock->getTargetEntityTypeId()); } /** * @covers ::getMode() */ public function testGetMode() { - $display = $this->getMockForAbstractClass('\Drupal\Core\Entity\EntityDisplayBase', array(), '', FALSE); - $display->set('mode', 'test'); - $this->assertEquals('test', $display->getMode()); + $mock = $this->getMockForAbstractClass('\Drupal\Core\Entity\EntityDisplayBase', array(), '', FALSE); + $reflection = new \ReflectionProperty($mock, 'mode'); + $reflection->setAccessible(TRUE); + $reflection->setValue($mock, 'test'); + $this->assertEquals('test', $mock->getMode()); } /** * @covers ::getOriginalMode() */ public function testGetOriginalMode() { - $display = $this->getMockForAbstractClass('\Drupal\Core\Entity\EntityDisplayBase', array(), '', FALSE); - $display->set('originalMode', 'test'); - $this->assertEquals('test', $display->getOriginalMode()); + $mock = $this->getMockForAbstractClass('\Drupal\Core\Entity\EntityDisplayBase', array(), '', FALSE); + $reflection = new \ReflectionProperty($mock, 'originalMode'); + $reflection->setAccessible(TRUE); + $reflection->setValue($mock, 'test'); + $this->assertEquals('test', $mock->getOriginalMode()); } /** - * @covers ::setDisplayBundle() * @covers ::getDisplayBundle() */ public function testGetDisplayBundle() { - $display = $this->getMockForAbstractClass('\Drupal\Core\Entity\EntityDisplayBase', array(), '', FALSE); - $display->setDisplayBundle('test'); - $this->assertEquals('test', $display->getDisplayBundle()); + $mock = $this->getMockForAbstractClass('\Drupal\Core\Entity\EntityDisplayBase', array(), '', FALSE); + $reflection = new \ReflectionProperty($mock, 'bundle'); + $reflection->setAccessible(TRUE); + $reflection->setValue($mock, 'test'); + $this->assertEquals('test', $mock->getDisplayBundle()); } - }