diff --git a/config/schema/islandora.schema.yml b/config/schema/islandora.schema.yml index de7a3e46..0ee69fc1 100644 --- a/config/schema/islandora.schema.yml +++ b/config/schema/islandora.schema.yml @@ -169,3 +169,11 @@ field.formatter.settings.islandora_image: image_style: type: string label: 'Image style' + image_loading: + type: mapping + label: 'Image loading settings' + mapping: + attribute: + type: string + label: 'Loading attribute' + diff --git a/tests/src/Functional/IslandoraImageFormatterTest.php b/tests/src/Functional/IslandoraImageFormatterTest.php index 75003463..33f6e1e6 100644 --- a/tests/src/Functional/IslandoraImageFormatterTest.php +++ b/tests/src/Functional/IslandoraImageFormatterTest.php @@ -10,11 +10,6 @@ namespace Drupal\Tests\islandora\Functional; */ class IslandoraImageFormatterTest extends IslandoraFunctionalTestBase { - /** - * @var bool Suppresses "Schema incomplete" error. - */ - protected $strictConfigSchema = FALSE; - /** * @covers \Drupal\islandora\Plugin\Field\FieldFormatter\IslandoraImageFormatter::viewElements */ @@ -31,16 +26,21 @@ class IslandoraImageFormatterTest extends IslandoraFunctionalTestBase { // Create an image media type. $testImageMediaType = $this->createMediaType('image', ['id' => 'test_image_media_type']); $testImageMediaType->save(); - $this->createEntityReferenceField('media', $testImageMediaType->id(), 'field_media_of', 'Media Of', 'node', 'default', [], 2);("Got past create media type."); + $this->createEntityReferenceField('media', $testImageMediaType->id(), 'field_media_of', 'Media Of', 'node', 'default', [], 2); // Set the display mode to use the islandora_image formatter. // Also, only show the image on display to remove clutter. $display_options = [ 'type' => 'islandora_image', - 'settings' => [/*'image_style' => NULL,*/ 'image_link' => 'content'], + 'settings' => [ + 'image_style' => '', + 'image_link' => 'content', + 'image_loading' => [ + 'attribute' => 'eager', + ], + ], ]; $display = $this->container->get('entity_display.repository')->getViewDisplay('media', $testImageMediaType->id(), 'default'); - $display->setComponent('field_media_image', $display_options) ->removeComponent('created') ->removeComponent('uid')