diff --git a/core/modules/system/tests/fixtures/update/drupal8.views-image-style-dependency-2649914.yml b/core/modules/system/tests/fixtures/update/drupal8.views-image-style-dependency-2649914.yml index 70d9caf..585da34 100644 --- a/core/modules/system/tests/fixtures/update/drupal8.views-image-style-dependency-2649914.yml +++ b/core/modules/system/tests/fixtures/update/drupal8.views-image-style-dependency-2649914.yml @@ -31,3 +31,13 @@ display: image_style: thumbnail image_link: '' plugin_id: field + field_image_1: + id: field_image_1 + table: node__field_image + field: field_image + type: image + settings: + # This field's formatter is using a non-existent image style. + image_style: nonexistent + image_link: '' + plugin_id: field diff --git a/core/modules/views/src/Tests/Update/ImageStyleDependencyUpdateTest.php b/core/modules/views/src/Tests/Update/ImageStyleDependencyUpdateTest.php index 627b15b..be2521c 100644 --- a/core/modules/views/src/Tests/Update/ImageStyleDependencyUpdateTest.php +++ b/core/modules/views/src/Tests/Update/ImageStyleDependencyUpdateTest.php @@ -36,6 +36,10 @@ public function testUpdateImageStyleDependencies() { // Checks that 'thumbnail' image style is not a dependency of view 'foo'. $this->assertFalse(in_array('image.style.thumbnail', $config_dependencies)); + // We test the case the the field formatter image style doesn't exist. + // Checks that 'nonexistent' image style is not a dependency of view 'foo'. + $this->assertFalse(in_array('image.style.nonexistent', $config_dependencies)); + // Run updates. $this->runUpdates(); @@ -43,6 +47,10 @@ public function testUpdateImageStyleDependencies() { // Checks that 'thumbnail' image style is a dependency of view 'foo'. $this->assertTrue(in_array('image.style.thumbnail', $config_dependencies)); + + // The 'nonexistent' style doesn't exist, thus is not a dependency. Checks + // that 'nonexistent' image style is a not dependency of view 'foo'. + $this->assertFalse(in_array('image.style.nonexistent', $config_dependencies)); } }