diff --git a/core/modules/config/src/Tests/ConfigEntityStorageTest.php b/core/modules/config/src/Tests/ConfigEntityStorageTest.php index 55b06ed..c1a7e0a 100644 --- a/core/modules/config/src/Tests/ConfigEntityStorageTest.php +++ b/core/modules/config/src/Tests/ConfigEntityStorageTest.php @@ -59,10 +59,14 @@ public function testToArray() { $id = 'test_1'; // Load the original configuration entity. entity_create($entity_type, ['id' => $id, 'protected_property' => 'TEST'])->save(); + /* @var $entity \Drupal\config_test\Entity\ConfigTest */ $entity = entity_load($entity_type, $id); $array = $entity->toArray(); - $this->assertEqual($array['protected_property'], 'TEST', 'Found protected Property on newly created entity.'); + $this->assertEqual($array['protected_property'], 'TEST', 'Found protected Property in exported Array with wrong syntax'); + $this->assertTrue(isset($array['protectedProperty']), 'Found protected Property in exported Array with correct syntax'); + $this->assertEqual($entity->getProtectedProperty(), 'TEST', 'Found protected Property on newly created entity.'); + $this->assertEqual($entity->getProtected_property(), 'TEST', 'Found protected Property on newly created entity.'); } } diff --git a/core/modules/config/tests/config_test/src/Entity/ConfigTest.php b/core/modules/config/tests/config_test/src/Entity/ConfigTest.php index 9fb6ca5..0ed71f1 100644 --- a/core/modules/config/tests/config_test/src/Entity/ConfigTest.php +++ b/core/modules/config/tests/config_test/src/Entity/ConfigTest.php @@ -155,6 +155,14 @@ public function setEnforcedDependencies(array $dependencies) { return $this; } + public function getProtectedProperty() { + return $this->protectedProperty; + } + + public function getProtected_property() { + return $this->protected_property; + } + /** * {@inheritdoc} */