function ResponsiveImageOrderMultipliersNumericallyUpdateTest::testUpdate

Same name in other branches
  1. 11.x core/modules/responsive_image/tests/src/Functional/ResponsiveImageOrderMultipliersNumericallyUpdateTest.php \Drupal\Tests\responsive_image\Functional\ResponsiveImageOrderMultipliersNumericallyUpdateTest::testUpdate()

Test order multipliers numerically upgrade path.

@legacy

See also

responsive_image_post_update_order_multiplier_numerically()

File

core/modules/responsive_image/tests/src/Functional/ResponsiveImageOrderMultipliersNumericallyUpdateTest.php, line 38

Class

ResponsiveImageOrderMultipliersNumericallyUpdateTest
Tests order multipliers numerically upgrade path.

Namespace

Drupal\Tests\responsive_image\Functional

Code

public function testUpdate() : void {
    $mappings = ResponsiveImageStyle::load('responsive_image_style')->getImageStyleMappings();
    $this->assertEquals('1.5x', $mappings[0]['multiplier']);
    $this->assertEquals('2x', $mappings[1]['multiplier']);
    $this->assertEquals('1x', $mappings[2]['multiplier']);
    $this->runUpdates();
    $mappings = ResponsiveImageStyle::load('responsive_image_style')->getImageStyleMappings();
    $this->assertEquals('1x', $mappings[0]['multiplier']);
    $this->assertEquals('1.5x', $mappings[1]['multiplier']);
    $this->assertEquals('2x', $mappings[2]['multiplier']);
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.