diff --git a/core/modules/field/src/Tests/DisplayApiTest.php b/core/modules/field/src/Tests/DisplayApiTest.php index 2fe67a3..a8ff4c0 100644 --- a/core/modules/field/src/Tests/DisplayApiTest.php +++ b/core/modules/field/src/Tests/DisplayApiTest.php @@ -217,7 +217,7 @@ function testFieldItemView() { $settings = \Drupal::service('plugin.manager.field.formatter')->getDefaultSettings('field_test_default'); $setting = $settings['test_formatter_setting']; foreach ($this->values as $delta => $value) { - $item = $this->entity->{$this->field_name}[$delta]; + $item = $this->entity->{$this->fieldName}[$delta]; $build = $item->view(); $this->render($build); $this->assertText($setting . '|' . $value['value'], format_string('Value @delta was displayed with expected setting.', array('@delta' => $delta))); @@ -232,7 +232,7 @@ function testFieldItemView() { ); $setting = $display['settings']['test_formatter_setting_multiple']; foreach ($this->values as $delta => $value) { - $item = $this->entity->{$this->field_name}[$delta]; + $item = $this->entity->{$this->fieldName}[$delta]; $build = $item->view($display); $this->render($build); $this->assertText($setting . '|0:' . $value['value'], format_string('Value @delta was displayed with expected setting.', array('@delta' => $delta))); @@ -247,7 +247,7 @@ function testFieldItemView() { ); $setting = $display['settings']['test_formatter_setting_additional']; foreach ($this->values as $delta => $value) { - $item = $this->entity->{$this->field_name}[$delta]; + $item = $this->entity->{$this->fieldName}[$delta]; $build = $item->view($display); $this->render($build); $this->assertText($setting . '|' . $value['value'] . '|' . ($value['value'] + 1), format_string('Value @delta was displayed with expected setting.', array('@delta' => $delta))); @@ -256,7 +256,7 @@ function testFieldItemView() { // View mode: check that display settings specified in the field are used. $setting = $this->displayOptions['teaser']['settings']['test_formatter_setting']; foreach ($this->values as $delta => $value) { - $item = $this->entity->{$this->field_name}[$delta]; + $item = $this->entity->{$this->fieldName}[$delta]; $build = $item->view('teaser'); $this->render($build); $this->assertText($setting . '|' . $value['value'], format_string('Value @delta was displayed with expected setting.', array('@delta' => $delta))); @@ -266,7 +266,7 @@ function testFieldItemView() { // are used. $setting = $this->displayOptions['default']['settings']['test_formatter_setting']; foreach ($this->values as $delta => $value) { - $item = $this->entity->{$this->field_name}[$delta]; + $item = $this->entity->{$this->fieldName}[$delta]; $build = $item->view('unknown_view_mode'); $this->render($build); $this->assertText($setting . '|' . $value['value'], format_string('Value @delta was displayed with expected setting.', array('@delta' => $delta))); diff --git a/core/modules/field/src/Tests/ShapeItemTest.php b/core/modules/field/src/Tests/ShapeItemTest.php index 6f6c9fa..9f7df3b 100644 --- a/core/modules/field/src/Tests/ShapeItemTest.php +++ b/core/modules/field/src/Tests/ShapeItemTest.php @@ -64,11 +64,11 @@ public function testShapeItem() { $id = $entity->id(); $entity = entity_load('entity_test', $id); $this->assertTrue($entity->{$this->fieldName} instanceof FieldItemListInterface, 'Field implements interface.'); - $this->assertTrue($entity->{$this->field_name}[0] instanceof FieldItemInterface, 'Field item implements interface.'); + $this->assertTrue($entity->{$this->fieldName}[0] instanceof FieldItemInterface, 'Field item implements interface.'); $this->assertEqual($entity->{$this->fieldName}->shape, $shape); $this->assertEqual($entity->{$this->fieldName}->color, $color); - $this->assertEqual($entity->{$this->field_name}[0]->shape, $shape); - $this->assertEqual($entity->{$this->field_name}[0]->color, $color); + $this->assertEqual($entity->{$this->fieldName}[0]->shape, $shape); + $this->assertEqual($entity->{$this->fieldName}[0]->color, $color); // Verify changing the field value. $new_shape = 'circle'; diff --git a/core/modules/field/src/Tests/TestItemTest.php b/core/modules/field/src/Tests/TestItemTest.php index 681561c..7aa4679 100644 --- a/core/modules/field/src/Tests/TestItemTest.php +++ b/core/modules/field/src/Tests/TestItemTest.php @@ -63,9 +63,9 @@ public function testTestItem() { $id = $entity->id(); $entity = entity_load('entity_test', $id); $this->assertTrue($entity->{$this->fieldName} instanceof FieldItemListInterface, 'Field implements interface.'); - $this->assertTrue($entity->{$this->field_name}[0] instanceof FieldItemInterface, 'Field item implements interface.'); + $this->assertTrue($entity->{$this->fieldName}[0] instanceof FieldItemInterface, 'Field item implements interface.'); $this->assertEqual($entity->{$this->fieldName}->value, $value); - $this->assertEqual($entity->{$this->field_name}[0]->value, $value); + $this->assertEqual($entity->{$this->fieldName}[0]->value, $value); // Verify changing the field value. $new_value = rand(1, 10); diff --git a/core/modules/field/src/Tests/TranslationTest.php b/core/modules/field/src/Tests/TranslationTest.php index 5cd6504..6e1d3fc 100644 --- a/core/modules/field/src/Tests/TranslationTest.php +++ b/core/modules/field/src/Tests/TranslationTest.php @@ -133,7 +133,7 @@ function testTranslatableFieldSaveLoad() { foreach ($field_translations as $langcode => $items) { $result = TRUE; foreach ($items as $delta => $item) { - $result = $result && $item['value'] == $entity->getTranslation($langcode)->{fieldName}[$delta]->value; + $result = $result && $item['value'] == $entity->getTranslation($langcode)->{$this->fieldName}[$delta]->value; } $this->assertTrue($result, format_string('%language translation correctly handled.', array('%language' => $langcode))); }