diff --git a/core/lib/Drupal/Core/Config/Schema/Sequence.php b/core/lib/Drupal/Core/Config/Schema/Sequence.php index a399583..43d3134 100644 --- a/core/lib/Drupal/Core/Config/Schema/Sequence.php +++ b/core/lib/Drupal/Core/Config/Schema/Sequence.php @@ -8,6 +8,7 @@ namespace Drupal\Core\Config\Schema; use Drupal\Core\TypedData\ListInterface; +use Drupal\Core\TypedData\TypedDataInterface; /** * Defines a configuration element of type Sequence. @@ -49,4 +50,26 @@ public function onChange($delta) { $this->parent->onChange($this->name); } } + + /** + * {@inheritdoc} + */ + public function first() { + return $this->get(0); + } + + /** + * {@inheritdoc} + */ + public function get($index) { + return $this->offsetGet($index); + } + + /** + * {@inheritdoc} + */ + public function set($index, $value) { + $this->offsetSet($index, $value); + } + } diff --git a/core/modules/link/lib/Drupal/link/Tests/LinkItemTest.php b/core/modules/link/lib/Drupal/link/Tests/LinkItemTest.php index e8af116..ccc9a91 100644 --- a/core/modules/link/lib/Drupal/link/Tests/LinkItemTest.php +++ b/core/modules/link/lib/Drupal/link/Tests/LinkItemTest.php @@ -58,7 +58,7 @@ public function testLinkItem() { $class = $this->randomName(); $entity->field_test->url = $url; $entity->field_test->title = $title; - $entity->field_test->get('attributes')->set('class', $class); + $entity->field_test->first()->get('attributes')->set('class', $class); $entity->name->value = $this->randomName(); $entity->save(); @@ -79,7 +79,7 @@ public function testLinkItem() { $new_class = $this->randomName(); $entity->field_test->url = $new_url; $entity->field_test->title = $new_title; - $entity->field_test->get('attributes')->set('class', $new_class); + $entity->field_test->first()->get('attributes')->set('class', $new_class); $this->assertEqual($entity->field_test->url, $new_url); $this->assertEqual($entity->field_test->title, $new_title); $this->assertEqual($entity->field_test->attributes['class'], $new_class); diff --git a/core/modules/rest/lib/Drupal/rest/Tests/NodeTest.php b/core/modules/rest/lib/Drupal/rest/Tests/NodeTest.php index 76773df..86df206 100644 --- a/core/modules/rest/lib/Drupal/rest/Tests/NodeTest.php +++ b/core/modules/rest/lib/Drupal/rest/Tests/NodeTest.php @@ -81,7 +81,7 @@ public function testNodes() { // Reload the node from the DB and check if the title was correctly updated. $updated_node = entity_load('node', $node->id(), TRUE); - $this->assertEqual($updated_node->get('title')->get('value')->getValue(), $new_title); + $this->assertEqual($updated_node->getTitle(), $new_title); // Make sure that the UUID of the node has not changed. $this->assertEqual($node->get('uuid')->getValue(), $updated_node->get('uuid')->getValue(), 'UUID was not changed.'); }