Skip to content

Commit b08acd8

Browse files
chore: update tests for f:best
1 parent 3db479b commit b08acd8

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

tests/test-lazyload.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -235,7 +235,7 @@ public function test_lazy_load_preserve_image_size() {
235235
$this->assertNotEquals( $replaced_content, $html );
236236
$this->assertStringNotContainsString( 'q:eco/rt:fill/g:ce', $replaced_content );
237237
$this->assertStringContainsString( '/rt:fill/g:ce', $replaced_content );
238-
$this->assertStringContainsString( '/w:96/h:96/q:eco/ig:avif/dpr:2/http://example.org/', $replaced_content );
238+
$this->assertStringContainsString( '/w:96/h:96/q:eco/f:best/dpr:2/http://example.org/', $replaced_content );
239239

240240
}
241241

@@ -248,7 +248,7 @@ public function test_width_100() {
248248

249249
$replaced_content = Optml_Manager::instance()->replace_content( $content );
250250

251-
$this->assertEquals( '<img decoding=async data-opt-id=1786304581 data-opt-src="https://test123.i.optimole.com/w:auto/h:auto/q:mauto/ig:avif/http://example.org/wp-content/uploads/2018/11/gradient.png" height="100%" src="https://test123.i.optimole.com/w:auto/h:auto/q:eco/ig:avif/http://example.org/wp-content/uploads/2018/11/gradient.png" class="at0px" width="100%"/><noscript><img decoding=async data-opt-id=1786304581 height="100%" src="https://test123.i.optimole.com/w:auto/h:auto/q:mauto/ig:avif/http://example.org/wp-content/uploads/2018/11/gradient.png" class="at0px" width="100%"/></noscript>', $replaced_content );
251+
$this->assertEquals( '<img decoding=async data-opt-id=1786304581 data-opt-src="https://test123.i.optimole.com/w:auto/h:auto/q:mauto/f:best/http://example.org/wp-content/uploads/2018/11/gradient.png" height="100%" src="https://test123.i.optimole.com/w:auto/h:auto/q:eco/f:best/http://example.org/wp-content/uploads/2018/11/gradient.png" class="at0px" width="100%"/><noscript><img decoding=async data-opt-id=1786304581 height="100%" src="https://test123.i.optimole.com/w:auto/h:auto/q:mauto/f:best/http://example.org/wp-content/uploads/2018/11/gradient.png" class="at0px" width="100%"/></noscript>', $replaced_content );
252252

253253
}
254254
public function test_check_with_no_script() {
@@ -542,7 +542,7 @@ public function test_generic_placeholder() {
542542

543543
public function test_dam_lazyloading() {
544544
$replaced_content = Optml_Manager::instance()->process_images_from_content( self::DAM_IMG_TAG );
545-
$this->assertStringContainsString( 'data-opt-src="https://cloudUrlTest.test/w:100/h:200/rt:fill/g:ce/ig:avif/q:mauto/id:b1b12ee03bf3945d9d9bb963ce79cd4f/https://test-site.test/9.jpg"', $replaced_content );
545+
$this->assertStringContainsString( 'data-opt-src="https://cloudUrlTest.test/w:100/h:200/rt:fill/g:ce/f:best/q:mauto/id:b1b12ee03bf3945d9d9bb963ce79cd4f/https://test-site.test/9.jpg"', $replaced_content );
546546
}
547547
public function test_dam_lazyloading_no_wh_attributes() {
548548
add_filter('optml_lazyload_images_skip','__return_zero');

tests/test-replacer.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -346,7 +346,7 @@ public function test_assets_url() {
346346
$this->assertStringContainsString( 'https://test123.i.optimole.com/cb:eFRn.20eff/f:js/q:mauto/m:0/http://example.org/wp-content/plugins/divi-bars/assets/js/snap.svg-min.js', $replaced_content );
347347
$this->assertStringContainsString( 'https://test123.i.optimole.com/cb:eFRn.20eff/f:css/q:mauto/m:1/http://example.org/wp-includes/js/hoverintent-js.min.png-random.css', $replaced_content );
348348
$this->assertStringContainsString( 'https://test123.i.optimole.com/cb:eFRn.20eff/f:js/q:mauto/m:0/http://example.org/wp-includes/js/assets/whatever.jpg.png.css.js', $replaced_content );
349-
$this->assertStringContainsString( 'https://test123.i.optimole.com/cb:eFRn.20eff/w:auto/h:auto/q:mauto/ig:avif/https://example.org/wp-includes/js/assets/whatever.jpg.jpg', $replaced_content );
349+
$this->assertStringContainsString( 'https://test123.i.optimole.com/cb:eFRn.20eff/w:auto/h:auto/q:mauto/f:best/https://example.org/wp-includes/js/assets/whatever.jpg.jpg', $replaced_content );
350350

351351
$settings = new Optml_Settings();
352352
$settings->update( 'css_minify', 'disabled' );

0 commit comments

Comments
 (0)