diff --git a/core/modules/config/lib/Drupal/config/Tests/ConfigEntityTest.php b/core/modules/config/lib/Drupal/config/Tests/ConfigEntityTest.php index f3ca94f..776c6ee 100644 --- a/core/modules/config/lib/Drupal/config/Tests/ConfigEntityTest.php +++ b/core/modules/config/lib/Drupal/config/Tests/ConfigEntityTest.php @@ -47,7 +47,6 @@ function testCRUD() { $default_langcode = \Drupal::languageManager()->getDefaultLanguage()->id; // Verify default properties on a newly created empty entity. $empty = entity_create('config_test'); - $this->assertIdentical($empty->id, NULL); $this->assertTrue($empty->uuid); $this->assertIdentical($empty->label, NULL); $this->assertIdentical($empty->style, NULL); @@ -106,7 +105,6 @@ function testCRUD() { 'label' => $this->randomString(), 'style' => $this->randomName(), )); - $this->assertIdentical($config_test->id, $expected['id']); $this->assertTrue($config_test->uuid); $this->assertNotEqual($config_test->uuid, $empty->uuid); $this->assertIdentical($config_test->label, $expected['label']); @@ -160,7 +158,7 @@ function testCRUD() { try { $id_length_config_test->save(); $this->pass(String::format("config_test entity with ID length @length was saved.", array( - '@length' => strlen($id_length_config_test->id)) + '@length' => strlen($id_length_config_test->id())) )); } catch (ConfigEntityIdLengthException $e) { @@ -174,7 +172,7 @@ function testCRUD() { try { $id_length_config_test->save(); $this->pass(String::format("config_test entity with ID length @length was saved.", array( - '@length' => strlen($id_length_config_test->id), + '@length' => strlen($id_length_config_test->id()), ))); } catch (ConfigEntityIdLengthException $e) { @@ -188,13 +186,13 @@ function testCRUD() { try { $status = $id_length_config_test->save(); $this->fail(String::format("config_test entity with ID length @length exceeding the maximum allowed length of @max saved successfully", array( - '@length' => strlen($id_length_config_test->id), + '@length' => strlen($id_length_config_test->id()), '@max' => static::MAX_ID_LENGTH, ))); } catch (ConfigEntityIdLengthException $e) { $this->pass(String::format("config_test entity with ID length @length exceeding the maximum allowed length of @max failed to save", array( - '@length' => strlen($id_length_config_test->id), + '@length' => strlen($id_length_config_test->id()), '@max' => static::MAX_ID_LENGTH, ))); } @@ -222,7 +220,7 @@ function testCRUD() { $this->assertIdentical($config_test->getOriginalId(), $old_id); // Rename. - $config_test->id = $new_id; + $config_test->set('id', $new_id); $this->assertIdentical($config_test->id(), $new_id); $status = $config_test->save(); $this->assertIdentical($status, SAVED_UPDATED); diff --git a/core/modules/config/tests/config_test/lib/Drupal/config_test/Entity/ConfigTest.php b/core/modules/config/tests/config_test/lib/Drupal/config_test/Entity/ConfigTest.php index 07ec50a..b1c1acd 100644 --- a/core/modules/config/tests/config_test/lib/Drupal/config_test/Entity/ConfigTest.php +++ b/core/modules/config/tests/config_test/lib/Drupal/config_test/Entity/ConfigTest.php @@ -48,7 +48,7 @@ class ConfigTest extends ConfigEntityBase implements ConfigTestInterface { * * @var string */ - public $id; + protected $id; /** * The human-readable name of the configuration entity. @@ -89,7 +89,10 @@ class ConfigTest extends ConfigEntityBase implements ConfigTestInterface { * {@inheritdoc} */ public function toArray() { - $properties = parent::toArray(); + $properties = array( + 'id' => $this->id(), + ); + $properties += parent::toArray(); $protected_names = array( 'protected_property', );