@@ -22,6 +22,11 @@ class Test_Dam extends WP_UnitTestCase {
2222 */
2323 private $ dam ;
2424
25+ /**
26+ * @var Optml_Manager
27+ */
28+ private $ manager ;
29+
2530 const MOCK_ATTACHMENTS = [
2631 [
2732 'url ' => 'https://cloudUrlTest.test/w:auto/h:auto/q:auto/id:b1b12ee03bf3945d9d9bb963ce79cd4f/https://test-site.test/9.jpg ' ,
@@ -83,6 +88,7 @@ public function setUp(): void {
8388
8489 $ plugin = Optml_Main::instance ();
8590 $ this ->dam = $ plugin ->dam ;
91+ $ this ->manager = $ plugin ->manager ;
8692 $ this ->settings = $ plugin ->admin ->settings ;
8793 $ this ->settings ->update ( 'service_data ' , [
8894 'cdn_key ' => 'test123 ' ,
@@ -339,7 +345,7 @@ public function test_alter_image_tag_w_h() {
339345 // Set these images as thumbnails.
340346 $ args = [ 'width ' => 150 , 'height ' => 150 , 'crop ' => true ];
341347 $ test_url = $ this ->dam ->replace_dam_url_args ( $ args , $ current_attachment ['url ' ] );
342- $ altered_dimensions = $ this ->dam -> alter_img_tag_w_h ( $ other_dimensions , $ test_url , [], $ id );
348+ $ altered_dimensions = $ this ->manager -> tag_replacer -> filter_image_src_get_dimensions ( $ other_dimensions , $ test_url , [], $ id );
343349
344350 $ this ->assertEquals ( 150 , $ altered_dimensions [0 ] );
345351 $ this ->assertEquals ( 150 , $ altered_dimensions [1 ] );
@@ -350,7 +356,7 @@ public function test_alter_image_tag_w_h() {
350356 $ args = $ this ->dam ->size_to_dimension ( $ size , wp_get_attachment_metadata ($ id ) );
351357
352358 $ test_url = $ this ->dam ->replace_dam_url_args ( $ args , $ current_attachment ['url ' ] );
353- $ altered_dimensions = $ this ->dam -> alter_img_tag_w_h ( $ other_dimensions , $ test_url , [], $ id );
359+ $ altered_dimensions = $ this ->manager -> tag_replacer -> filter_image_src_get_dimensions ( $ other_dimensions , $ test_url , [], $ id );
354360
355361 $ this ->assertEquals ( $ image_size_args ['width ' ], $ altered_dimensions [0 ] );
356362 $ this ->assertEquals ( $ image_size_args ['height ' ], $ altered_dimensions [1 ] );
@@ -364,7 +370,7 @@ public function test_alter_image_tag_w_h() {
364370 ];
365371
366372 $ test_url = $ this ->dam ->replace_dam_url_args ( $ args , $ current_attachment ['url ' ] );
367- $ altered_dimensions = $ this ->dam -> alter_img_tag_w_h ( $ other_dimensions , $ test_url , [], $ id );
373+ $ altered_dimensions = $ this ->manager -> tag_replacer -> filter_image_src_get_dimensions ( $ other_dimensions , $ test_url , [], $ id );
368374
369375 $ this ->assertEquals ( $ other_dimensions [0 ], $ altered_dimensions [0 ] );
370376 $ this ->assertEquals ( $ other_dimensions [1 ], $ altered_dimensions [1 ] );
0 commit comments