silverstripe / silverstripe-assets

Silverstripe Assets component
BSD 3-Clause "New" or "Revised" License
9 stars 65 forks source link

MNT Fix variant for image manipulation test #518

Closed GuySartorelli closed 1 year ago

GuySartorelli commented 1 year ago

Fixes https://github.com/silverstripe/silverstripe-assets/actions/runs/3139439033/jobs/5099856508

SilverStripe\Assets\Tests\ImageManipulationTest::testRender with data set "ImageManipulation" ('$Me.CropWidth(100)', '<img width="100" height="300"...zy" />')
Failed asserting that two strings are equal.
--- Expected
+++ Actual
@@ @@
-'<img width="100" height="300" alt="This is a image Title" src="/assets/ImageTest/folder/test-image__CropWidthWyIxMDAiXQ.png" loading="lazy" />'
+'<img width="100" height="300" alt="This is a image Title" src="/assets/ImageTest/folder/test-image__CropWidthWzEwMF0.png" loading="lazy" />'

The old base64 encoded string "WyIxMDAiXQ" evaluates to ["100"], and the new one ("WzEwMF0") evaluates to [100]. This is a result of this PR in framework which allows primitive types to be passed directly to method arguments in templates. So where 100 had previously been interpreted as a string through the template logic, it's now a true int.

Parent issue