File tree Expand file tree Collapse file tree 1 file changed +32
-0
lines changed Expand file tree Collapse file tree 1 file changed +32
-0
lines changed Original file line number Diff line number Diff line change @@ -614,6 +614,38 @@ public function data_image_blocks_with_relative_alignment(): array {
614
614
);
615
615
}
616
616
617
+ /**
618
+ * Test the image block with different alignment in classic theme.
619
+ *
620
+ * @dataProvider data_image_blocks_with_relative_alignment_for_classic_theme
621
+ *
622
+ * @param string $image_alignment Image alignment.
623
+ */
624
+ public function test_image_block_with_different_alignment_in_classic_theme ( string $ image_alignment ): void {
625
+ switch_theme ( 'twentytwentyone ' );
626
+
627
+ $ block_content = $ this ->get_image_block_markup ( self ::$ image_id , 'large ' , $ image_alignment );
628
+
629
+ $ result = apply_filters ( 'the_content ' , $ block_content );
630
+
631
+ $ this ->assertStringContainsString ( 'sizes="(max-width: 1024px) 100vw, 1024px" ' , $ result );
632
+ }
633
+
634
+ /**
635
+ * Data provider.
636
+ *
637
+ * @return array<array<string>> The ancestor and image alignments.
638
+ */
639
+ public function data_image_blocks_with_relative_alignment_for_classic_theme (): array {
640
+ return array (
641
+ array ( '' ),
642
+ array ( 'wide ' ),
643
+ array ( 'left ' ),
644
+ array ( 'center ' ),
645
+ array ( 'right ' ),
646
+ );
647
+ }
648
+
617
649
/**
618
650
* Filter the theme.json data to include relative layout sizes.
619
651
*
You can’t perform that action at this time.
0 commit comments