diff --git a/core/modules/responsive_image/config/schema/responsive_image.schema.yml b/core/modules/responsive_image/config/schema/responsive_image.schema.yml index f574d87..430dc47 100644 --- a/core/modules/responsive_image/config/schema/responsive_image.schema.yml +++ b/core/modules/responsive_image/config/schema/responsive_image.schema.yml @@ -10,12 +10,12 @@ responsive_image.mappings.*: label: type: label label: 'Label' - mappings: + mappingDefinitions: type: sequence - label: 'Mappings' + label: 'Mapping definitions' sequence: - type: mapping - label: 'Mapping' + label: 'Mapping definition' mapping: # Image mapping type. Either 'sizes' (using the 'sizes' attribute) # or 'image_style' (using a single image style to map to this diff --git a/core/modules/responsive_image/responsive_image.module b/core/modules/responsive_image/responsive_image.module index 56d9797..ee10739 100644 --- a/core/modules/responsive_image/responsive_image.module +++ b/core/modules/responsive_image/responsive_image.module @@ -181,7 +181,7 @@ function template_preprocess_responsive_image(&$variables) { $image = \Drupal::service('image.factory')->get($variables['uri']); $variables['sources'] = responsive_image_build_source_attributes($image, $variables); - // Output the fallback image. Use srcset in the fallback image to avoid + // Prepare the fallback image. Use srcset in the fallback image to avoid // unnecessary preloading of images in older browsers. See // http://scottjehl.github.io/picturefill/#using-picture and // http://scottjehl.github.io/picturefill/#gotchas for more information. @@ -199,6 +199,7 @@ function template_preprocess_responsive_image(&$variables) { } } } + /** * Helper function for template_preprocess_responsive_image(). * @@ -307,7 +308,7 @@ function responsive_image_build_source_attributes(ImageInterface $image, $variab $responsive_image_mapping = ResponsiveImageMapping::load($variables['mapping_id']); // All breakpoints and multipliers. $breakpoints = \Drupal::service('breakpoint.manager')->getBreakpointsByGroup($responsive_image_mapping->getBreakpointGroup()); - foreach ($responsive_image_mapping->getKeyedMappings() as $breakpoint_id => $multipliers) { + foreach ($responsive_image_mapping->getKeyedMappingDefinitions() as $breakpoint_id => $multipliers) { if (isset($breakpoints[$breakpoint_id])) { $breakpoint = $breakpoints[$breakpoint_id]; $sizes = array(); @@ -330,7 +331,12 @@ function responsive_image_build_source_attributes(ImageInterface $image, $variab // it. Because of this, the image styles for all multipliers of // this breakpoint should be merged into one srcset and the sizes // attribute should be merged as well. - $srcset[floatval($dimensions['width'])] = file_create_url(_responsive_image_image_style_url($image_style_name, $image->getSource())) . ' ' . $dimensions['width'] . 'w'; + if (!is_null($dimensions['width'])) { + $srcset[floatval($dimensions['width'])] = file_create_url(_responsive_image_image_style_url($image_style_name, $image->getSource())) . ' ' . $dimensions['width'] . 'w'; + } + else { + \Drupal::logger('responsive_image')->warning('Could not determine image width for @file using image style with ID: @image_style_name', array('@file' => $image->getSource(), '@image_style_name' => $image_style_name)); + } $sizes = array_merge(explode(',', $mapping_definition['image_mapping']['sizes']), $sizes); } break; diff --git a/core/modules/responsive_image/src/Entity/ResponsiveImageMapping.php b/core/modules/responsive_image/src/Entity/ResponsiveImageMapping.php index c600f51..9a60f23 100644 --- a/core/modules/responsive_image/src/Entity/ResponsiveImageMapping.php +++ b/core/modules/responsive_image/src/Entity/ResponsiveImageMapping.php @@ -57,21 +57,28 @@ class ResponsiveImageMapping extends ConfigEntityBase implements ResponsiveImage protected $label; /** - * The responsive image mappings. + * The responsive image mapping definitions. * - * Each responsive mapping array contains the following keys: - * - breakpoint_id - * - multiplier - * - image_style + * Each mapping definition array contains the following keys: + * - image_mapping_type: Either 'image_style' or 'sizes'. + * - image_mapping: + * - If image_mapping_type is 'image_style', the image style ID. + * - If image_mapping_type is 'sizes', an array with following keys: + * - sizes: If image_mapping_type is 'sizes', the value for the + * 'sizes' attribute. + * - sizes_image_styles: The image styles to use for the 'srcset' + * attribute. + * - breakpoint_id: The breakpoint ID for this mapping definition. + * - multiplier: The multiplier for this mapping definition. * * @var array */ - protected $mappings = array(); + protected $mappingDefinitions = array(); /** * @var array */ - protected $keyedMappings; + protected $keyedMappingDefinitions; /** * The responsive image breakpoint group. @@ -90,13 +97,13 @@ public function __construct(array $values, $entity_type_id = 'responsive_image_m /** * {@inheritdoc} */ - public function addMapping($breakpoint_id, $multiplier, array $mapping_definition) { + public function addMappingDefinition($breakpoint_id, $multiplier, array $mapping_definition) { $defaults = array( 'image_mapping_type' => 'image_style', 'image_mapping' => '', ); // If there is an existing mapping, overwrite it. - foreach ($this->mappings as &$mapping) { + foreach ($this->mappingDefinitions as &$mapping) { if ($mapping['breakpoint_id'] === $breakpoint_id && $mapping['multiplier'] === $multiplier) { $mapping = array( 'breakpoint_id' => $breakpoint_id, @@ -105,55 +112,56 @@ public function addMapping($breakpoint_id, $multiplier, array $mapping_definitio return $this; } } - $this->mappings[] = array( + $this->mappingDefinitions[] = array( 'breakpoint_id' => $breakpoint_id, 'multiplier' => $multiplier, ) + $mapping_definition + $defaults; - $this->keyedMappings = NULL; + $this->keyedMappingDefinitions = NULL; return $this; } /** * {@inheritdoc} */ - public function hasMappings() { - $mappings = $this->getKeyedMappings(); + public function hasMappingDefinitions() { + $mappings = $this->getKeyedMappingDefinitions(); return !empty($mappings); } /** * {@inheritdoc} */ - public function getKeyedMappings() { - if (!$this->keyedMappings) { - $this->keyedMappings = array(); - foreach($this->mappings as $mapping) { + public function getKeyedMappingDefinitions() { + if (!$this->keyedMappingDefinitions) { + $this->keyedMappingDefinitions = array(); + foreach($this->mappingDefinitions as $mapping) { if (!$this->isEmptyMappingDefinition($mapping)) { // Only return the selected image styles. if ($mapping['image_mapping_type'] == 'sizes') { $mapping['image_mapping']['sizes_image_styles'] = array_filter($mapping['image_mapping']['sizes_image_styles']); } - $this->keyedMappings[$mapping['breakpoint_id']][$mapping['multiplier']] = $mapping; + $this->keyedMappingDefinitions[$mapping['breakpoint_id']][$mapping['multiplier']] = $mapping; } } } - return $this->keyedMappings; + return $this->keyedMappingDefinitions; } /** * {@inheritdoc} */ - public function getMappings() { - return $this->get('mappings'); + public function getMappingDefinitions() { + return $this->get('mappingDefinitions'); } /** * {@inheritdoc} */ public function setBreakpointGroup($breakpoint_group) { - // If the breakpoint group is changed then the mappings are invalid. + // If the breakpoint group is changed then the mapping definitions are + // invalid. if ($breakpoint_group !== $this->breakpointGroup) { - $this->removeMappings(); + $this->removeMappingDefinitions(); } $this->set('breakpointGroup', $breakpoint_group); return $this; @@ -169,9 +177,9 @@ public function getBreakpointGroup() { /** * {@inheritdoc} */ - public function removeMappings() { - $this->mappings = array(); - $this->keyedMappings = NULL; + public function removeMappingDefinitions() { + $this->mappingDefinitions = array(); + $this->keyedMappingDefinitions = NULL; return $this; } @@ -215,7 +223,7 @@ public static function isEmptyMappingDefinition(array $mapping_definition) { * {@inheritdoc} */ public function getMappingDefinition($breakpoint_id, $multiplier) { - $map = $this->getKeyedMappings(); + $map = $this->getKeyedMappingDefinitions(); if (isset($map[$breakpoint_id][$multiplier])) { return $map[$breakpoint_id][$multiplier]; } diff --git a/core/modules/responsive_image/src/Plugin/Field/FieldFormatter/ResponsiveImageFormatter.php b/core/modules/responsive_image/src/Plugin/Field/FieldFormatter/ResponsiveImageFormatter.php index 5ed1e3b7..32c9eeb 100644 --- a/core/modules/responsive_image/src/Plugin/Field/FieldFormatter/ResponsiveImageFormatter.php +++ b/core/modules/responsive_image/src/Plugin/Field/FieldFormatter/ResponsiveImageFormatter.php @@ -198,7 +198,7 @@ public function viewElements(FieldItemListInterface $items) { $cache_tags = []; if ($responsive_image_mapping) { $cache_tags = Cache::mergeTags($cache_tags, $responsive_image_mapping->getCacheTags()); - foreach ($responsive_image_mapping->getMappings() as $mapping) { + foreach ($responsive_image_mapping->getMappingDefinitions() as $mapping) { // Only image styles of non-empty mappings should be loaded. if (!$responsive_image_mapping::isEmptyMappingDefinition($mapping)) { diff --git a/core/modules/responsive_image/src/ResponsiveImageMappingForm.php b/core/modules/responsive_image/src/ResponsiveImageMappingForm.php index 6090495..2973413 100644 --- a/core/modules/responsive_image/src/ResponsiveImageMappingForm.php +++ b/core/modules/responsive_image/src/ResponsiveImageMappingForm.php @@ -148,11 +148,11 @@ public function save(array $form, FormStateInterface $form_state) { /** @var \Drupal\responsive_image\ResponsiveImageMappingInterface $responsive_image_mapping */ $responsive_image_mapping = $this->entity; // Remove all the existing mappings and replace with submitted values. - $responsive_image_mapping->removeMappings(); + $responsive_image_mapping->removeMappingDefinitions(); if ($form_state->hasValue('keyed_mappings')) { foreach ($form_state->getValue('keyed_mappings') as $breakpoint_id => $multipliers) { foreach ($multipliers as $multiplier => $mapping) { - $responsive_image_mapping->addMapping($breakpoint_id, $multiplier, $mapping); + $responsive_image_mapping->addMappingDefinition($breakpoint_id, $multiplier, $mapping); } } } @@ -163,7 +163,7 @@ public function save(array $form, FormStateInterface $form_state) { // Redirect to edit form after creating a new mapping or after selecting // another breakpoint group. - if (!$responsive_image_mapping->hasMappings()) { + if (!$responsive_image_mapping->hasMappingDefinitions()) { $form_state->setRedirect( 'entity.responsive_image_mapping.edit_form', array('responsive_image_mapping' => $responsive_image_mapping->id()) diff --git a/core/modules/responsive_image/src/ResponsiveImageMappingInterface.php b/core/modules/responsive_image/src/ResponsiveImageMappingInterface.php index 7457aee..b35a727 100644 --- a/core/modules/responsive_image/src/ResponsiveImageMappingInterface.php +++ b/core/modules/responsive_image/src/ResponsiveImageMappingInterface.php @@ -20,7 +20,7 @@ * return bool * Whether the entity has any responsive image mappings. */ - public function hasMappings(); + public function hasMappingDefinitions(); /** * Returns the mappings of breakpoint ID and multiplier to image style. @@ -39,7 +39,7 @@ public function hasMappings(); * - breakpoint_id: The breakpoint ID for this mapping. * - multiplier: The multiplier for this mapping. */ - public function getKeyedMappings(); + public function getKeyedMappingDefinitions(); /** * Returns the mappings for the responsive image mapping. @@ -52,7 +52,7 @@ public function getKeyedMappings(); * - image_mapping_type * - image_mapping */ - public function getMappings(); + public function getMappingDefinitions(); /** * Sets the breakpoint group for the responsive_image mapping. @@ -119,13 +119,13 @@ public static function isEmptyMappingDefinition(array $mapping_definition); * * @return $this */ - public function addMapping($breakpoint_id, $multiplier, array $mapping_definition); + public function addMappingDefinition($breakpoint_id, $multiplier, array $mapping_definition); /** * Removes all mappings from the responsive image configuration entity. * * @return $this */ - public function removeMappings(); + public function removeMappingDefinitions(); } diff --git a/core/modules/responsive_image/src/Tests/ResponsiveImageFieldDisplayTest.php b/core/modules/responsive_image/src/Tests/ResponsiveImageFieldDisplayTest.php index eee1161..281d03e 100644 --- a/core/modules/responsive_image/src/Tests/ResponsiveImageFieldDisplayTest.php +++ b/core/modules/responsive_image/src/Tests/ResponsiveImageFieldDisplayTest.php @@ -100,18 +100,18 @@ public function testResponsiveImageFieldFormattersEmptyStyle() { protected function addTestMappings($empty_styles = FALSE) { if ($empty_styles) { $this->responsiveImgMapping - ->addMapping('responsive_image_test_module.mobile', '1x', array( + ->addMappingDefinition('responsive_image_test_module.mobile', '1x', array( 'image_mapping_type' => 'image_style', 'image_mapping' => '', )) - ->addMapping('responsive_image_test_module.narrow', '1x', array( + ->addMappingDefinition('responsive_image_test_module.narrow', '1x', array( 'image_mapping_type' => 'sizes', 'image_mapping' => array( 'sizes' => '(min-width: 700px) 700px, 100vw', 'sizes_image_styles' => array(), ), )) - ->addMapping('responsive_image_test_module.wide', '1x', array( + ->addMappingDefinition('responsive_image_test_module.wide', '1x', array( 'image_mapping_type' => 'image_style', 'image_mapping' => '', )) @@ -119,11 +119,11 @@ protected function addTestMappings($empty_styles = FALSE) { } else { $this->responsiveImgMapping - ->addMapping('responsive_image_test_module.mobile', '1x', array( + ->addMappingDefinition('responsive_image_test_module.mobile', '1x', array( 'image_mapping_type' => 'image_style', 'image_mapping' => RESPONSIVE_IMAGE_EMPTY_IMAGE, )) - ->addMapping('responsive_image_test_module.narrow', '1x', array( + ->addMappingDefinition('responsive_image_test_module.narrow', '1x', array( 'image_mapping_type' => 'sizes', 'image_mapping' => array( 'sizes' => '(min-width: 700px) 700px, 100vw', @@ -133,7 +133,7 @@ protected function addTestMappings($empty_styles = FALSE) { ), ), )) - ->addMapping('responsive_image_test_module.wide', '1x', array( + ->addMappingDefinition('responsive_image_test_module.wide', '1x', array( 'image_mapping_type' => 'image_style', 'image_mapping' => 'large', )) diff --git a/core/modules/responsive_image/templates/responsive-image.html.twig b/core/modules/responsive_image/templates/responsive-image.html.twig index 6e91316..12501e0 100644 --- a/core/modules/responsive_image/templates/responsive-image.html.twig +++ b/core/modules/responsive_image/templates/responsive-image.html.twig @@ -1,7 +1,7 @@ {# /** * @file - * Default theme implementation of a tag. + * Default theme implementation of a responsive image. * * Available variables: * - attributes: HTML attributes for the tag. diff --git a/core/modules/responsive_image/tests/src/Unit/ResponsiveImageMappingConfigEntityUnitTest.php b/core/modules/responsive_image/tests/src/Unit/ResponsiveImageMappingConfigEntityUnitTest.php index 4e59b3c..493ddb5 100644 --- a/core/modules/responsive_image/tests/src/Unit/ResponsiveImageMappingConfigEntityUnitTest.php +++ b/core/modules/responsive_image/tests/src/Unit/ResponsiveImageMappingConfigEntityUnitTest.php @@ -79,28 +79,28 @@ public function testCalculateDependencies() { } /** - * @covers ::addMapping - * @covers ::hasMappings + * @covers ::addMappingDefinition + * @covers ::hasMappingDefinitions */ - public function testHasMappings() { + public function testHasMappingDefinitions() { $entity = new ResponsiveImageMapping(array()); - $this->assertFalse($entity->hasMappings()); - $entity->addMapping('test_breakpoint', '1x', array( + $this->assertFalse($entity->hasMappingDefinitions()); + $entity->addMappingDefinition('test_breakpoint', '1x', array( 'image_mapping_type' => 'image_style', 'image_mapping' => '', )); - $this->assertFalse($entity->hasMappings()); - $entity->removeMappings(); - $entity->addMapping('test_breakpoint', '1x', array( + $this->assertFalse($entity->hasMappingDefinitions()); + $entity->removeMappingDefinitions(); + $entity->addMappingDefinition('test_breakpoint', '1x', array( 'image_mapping_type' => 'sizes', 'image_mapping' => array( 'sizes' => '(min-width:700px) 700px, 100vw', 'sizes_image_styles' => array(), ), )); - $this->assertFalse($entity->hasMappings()); - $entity->removeMappings(); - $entity->addMapping('test_breakpoint', '1x', array( + $this->assertFalse($entity->hasMappingDefinitions()); + $entity->removeMappingDefinitions(); + $entity->addMappingDefinition('test_breakpoint', '1x', array( 'image_mapping_type' => 'sizes', 'image_mapping' => array( 'sizes' => '', @@ -109,15 +109,15 @@ public function testHasMappings() { ), ), )); - $this->assertFalse($entity->hasMappings()); - $entity->removeMappings(); - $entity->addMapping('test_breakpoint', '1x', array( + $this->assertFalse($entity->hasMappingDefinitions()); + $entity->removeMappingDefinitions(); + $entity->addMappingDefinition('test_breakpoint', '1x', array( 'image_mapping_type' => 'image_style', 'image_mapping' => 'large', )); - $this->assertTrue($entity->hasMappings()); - $entity->removeMappings(); - $entity->addMapping('test_breakpoint', '1x', array( + $this->assertTrue($entity->hasMappingDefinitions()); + $entity->removeMappingDefinitions(); + $entity->addMappingDefinition('test_breakpoint', '1x', array( 'image_mapping_type' => 'sizes', 'image_mapping' => array( 'sizes' => '(min-width:700px) 700px, 100vw', @@ -126,16 +126,16 @@ public function testHasMappings() { ), ), )); - $this->assertTrue($entity->hasMappings()); + $this->assertTrue($entity->hasMappingDefinitions()); } /** - * @covers ::addMapping + * @covers ::addMappingDefinition * @covers ::getMappingDefinition */ public function testGetMappingDefinition() { $entity = new ResponsiveImageMapping(array('')); - $entity->addMapping('test_breakpoint', '1x', array( + $entity->addMappingDefinition('test_breakpoint', '1x', array( 'image_mapping_type' => 'image_style', 'image_mapping' => 'large', )); @@ -150,16 +150,16 @@ public function testGetMappingDefinition() { } /** - * @covers ::addMapping - * @covers ::getMappings + * @covers ::addMappingDefinition + * @covers ::getKeyedMappingDefinitions */ - public function testGetKeyedMappings() { + public function testGetKeyedMappingDefinitions() { $entity = new ResponsiveImageMapping(array('')); - $entity->addMapping('test_breakpoint', '1x', array( + $entity->addMappingDefinition('test_breakpoint', '1x', array( 'image_mapping_type' => 'image_style', 'image_mapping' => 'large', )); - $entity->addMapping('test_breakpoint', '2x', array( + $entity->addMappingDefinition('test_breakpoint', '2x', array( 'image_mapping_type' => 'sizes', 'image_mapping' => array( 'sizes' => '(min-width:700px) 700px, 100vw', @@ -168,7 +168,7 @@ public function testGetKeyedMappings() { ), ), )); - $entity->addMapping('test_breakpoint2', '1x', array( + $entity->addMappingDefinition('test_breakpoint2', '1x', array( 'image_mapping_type' => 'image_style', 'image_mapping' => 'thumbnail', )); @@ -202,10 +202,10 @@ public function testGetKeyedMappings() { ), ) ); - $this->assertEquals($expected, $entity->getKeyedMappings()); + $this->assertEquals($expected, $entity->getKeyedMappingDefinitions()); // Add another mapping to ensure keyed mapping static cache is rebuilt. - $entity->addMapping('test_breakpoint2', '2x', array( + $entity->addMappingDefinition('test_breakpoint2', '2x', array( 'image_mapping_type' => 'image_style', 'image_mapping' => 'medium', )); @@ -215,20 +215,20 @@ public function testGetKeyedMappings() { 'image_mapping_type' => 'image_style', 'image_mapping' => 'medium', ); - $this->assertEquals($expected, $entity->getKeyedMappings()); + $this->assertEquals($expected, $entity->getKeyedMappingDefinitions()); } /** - * @covers ::addMapping - * @covers ::getMappings + * @covers ::addMappingDefinition + * @covers ::getMappingDefinitions */ - public function testGetMappings() { + public function testGetMappingDefinitions() { $entity = new ResponsiveImageMapping(array('')); - $entity->addMapping('test_breakpoint', '1x', array( + $entity->addMappingDefinition('test_breakpoint', '1x', array( 'image_mapping_type' => 'image_style', 'image_mapping' => 'large', )); - $entity->addMapping('test_breakpoint', '2x', array( + $entity->addMappingDefinition('test_breakpoint', '2x', array( 'image_mapping_type' => 'sizes', 'image_mapping' => array( 'sizes' => '(min-width:700px) 700px, 100vw', @@ -237,7 +237,7 @@ public function testGetMappings() { ), ), )); - $entity->addMapping('test_breakpoint2', '1x', array( + $entity->addMappingDefinition('test_breakpoint2', '1x', array( 'image_mapping_type' => 'image_style', 'image_mapping' => 'thumbnail', )); @@ -267,20 +267,20 @@ public function testGetMappings() { 'image_mapping' => 'thumbnail', ), ); - $this->assertEquals($expected, $entity->getMappings()); + $this->assertEquals($expected, $entity->getMappingDefinitions()); } /** - * @covers ::addMapping - * @covers ::removeMappings + * @covers ::addMappingDefinition + * @covers ::removeMappingDefinitions */ - public function testRemoveMappings() { + public function testRemoveMappingDefinitions() { $entity = new ResponsiveImageMapping(array('')); - $entity->addMapping('test_breakpoint', '1x', array( + $entity->addMappingDefinition('test_breakpoint', '1x', array( 'image_mapping_type' => 'image_style', 'image_mapping' => 'large', )); - $entity->addMapping('test_breakpoint', '2x', array( + $entity->addMappingDefinition('test_breakpoint', '2x', array( 'image_mapping_type' => 'sizes', 'image_mapping' => array( 'sizes' => '(min-width:700px) 700px, 100vw', @@ -289,16 +289,16 @@ public function testRemoveMappings() { ), ), )); - $entity->addMapping('test_breakpoint2', '1x', array( + $entity->addMappingDefinition('test_breakpoint2', '1x', array( 'image_mapping_type' => 'image_style', 'image_mapping' => 'thumbnail', )); - $this->assertTrue($entity->hasMappings()); - $entity->removeMappings(); - $this->assertEmpty($entity->getMappings()); - $this->assertEmpty($entity->getKeyedMappings()); - $this->assertFalse($entity->hasMappings()); + $this->assertTrue($entity->hasMappingDefinitions()); + $entity->removeMappingDefinitions(); + $this->assertEmpty($entity->getMappingDefinitions()); + $this->assertEmpty($entity->getKeyedMappingDefinitions()); + $this->assertFalse($entity->hasMappingDefinitions()); } /** @@ -307,11 +307,11 @@ public function testRemoveMappings() { */ public function testSetBreakpointGroup() { $entity = new ResponsiveImageMapping(array('breakpointGroup' => 'test_group')); - $entity->addMapping('test_breakpoint', '1x', array( + $entity->addMappingDefinition('test_breakpoint', '1x', array( 'image_mapping_type' => 'image_style', 'image_mapping' => 'large', )); - $entity->addMapping('test_breakpoint', '2x', array( + $entity->addMappingDefinition('test_breakpoint', '2x', array( 'image_mapping_type' => 'sizes', 'image_mapping' => array( 'sizes' => '(min-width:700px) 700px, 100vw', @@ -320,20 +320,20 @@ public function testSetBreakpointGroup() { ), ), )); - $entity->addMapping('test_breakpoint2', '1x', array( + $entity->addMappingDefinition('test_breakpoint2', '1x', array( 'image_mapping_type' => 'image_style', 'image_mapping' => 'thumbnail', )); // Ensure that setting to same group does not remove mappings. $entity->setBreakpointGroup('test_group'); - $this->assertTrue($entity->hasMappings()); + $this->assertTrue($entity->hasMappingDefinitions()); $this->assertEquals('test_group', $entity->getBreakpointGroup()); // Ensure that changing the group removes mappings. $entity->setBreakpointGroup('test_group2'); $this->assertEquals('test_group2', $entity->getBreakpointGroup()); - $this->assertFalse($entity->hasMappings()); + $this->assertFalse($entity->hasMappingDefinitions()); } }