public function ResponsiveImageStyleConfigEntityUnitTest::testGetImageStyleMapping in Zircon Profile 8
Same name and namespace in other branches
- 8.0 core/modules/responsive_image/tests/src/Unit/ResponsiveImageStyleConfigEntityUnitTest.php \Drupal\Tests\responsive_image\Unit\ResponsiveImageStyleConfigEntityUnitTest::testGetImageStyleMapping()
@covers ::addImageStyleMapping @covers ::getImageStyleMapping
File
- core/
modules/ responsive_image/ tests/ src/ Unit/ ResponsiveImageStyleConfigEntityUnitTest.php, line 172 - Contains \Drupal\Tests\responsive_image\Unit\ResponsiveImageStyleConfigEntityUnitTest.
Class
- ResponsiveImageStyleConfigEntityUnitTest
- @coversDefaultClass \Drupal\responsive_image\Entity\ResponsiveImageStyle @group block
Namespace
Drupal\Tests\responsive_image\UnitCode
public function testGetImageStyleMapping() {
$entity = new ResponsiveImageStyle(array(
'',
));
$entity
->addImageStyleMapping('test_breakpoint', '1x', array(
'image_mapping_type' => 'image_style',
'image_mapping' => 'large',
));
$expected = array(
'breakpoint_id' => 'test_breakpoint',
'multiplier' => '1x',
'image_mapping_type' => 'image_style',
'image_mapping' => 'large',
);
$this
->assertEquals($expected, $entity
->getImageStyleMapping('test_breakpoint', '1x'));
$this
->assertNull($entity
->getImageStyleMapping('test_unknown_breakpoint', '1x'));
}