Skip to content

Commit bba4997

Browse files
Add more unit tests
1 parent 3a51aed commit bba4997

File tree

1 file changed

+72
-18
lines changed

1 file changed

+72
-18
lines changed

plugins/auto-sizes/tests/test-improve-calculate-sizes.php

Lines changed: 72 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1090,118 +1090,172 @@ public function test_image_block_with_parent_columns_and_its_parent_group_block(
10901090
public function data_image_block_with_parent_columns_and_its_parent_group_block(): array {
10911091
return array(
10921092
// Parent default alignment.
1093-
'Return 66.66% width of contentSize 413px, parent block default alignment, image block default alignment' => array(
1093+
'Return 66.66% width of contentSize 413px, group block default alignment, columns block default alignment, image block default alignment' => array(
10941094
'',
10951095
'',
10961096
'',
10971097
'sizes="(max-width: 413px) 100vw, 413px" ',
10981098
),
1099-
'Return 66.66% width of contentSize 413px, parent block default alignment, image block wide alignment' => array(
1099+
'Return 66.66% width of contentSize 413px, group block default alignment, columns block default alignment, image block wide alignment' => array(
11001100
'',
11011101
'',
11021102
'wide',
11031103
'sizes="(max-width: 413px) 100vw, 413px" ',
11041104
),
1105-
'Return 66.66% width of contentSize 413px, parent block default alignment, image block full alignment' => array(
1105+
'Return 66.66% width of contentSize 413px, group block default alignment, columns block default alignment, image block full alignment' => array(
11061106
'',
11071107
'',
11081108
'full',
11091109
'sizes="(max-width: 413px) 100vw, 413px" ',
11101110
),
1111-
'Return 66.66% width of contentSize 413px, parent block default alignment, image block left alignment' => array(
1111+
'Return 66.66% width of contentSize 413px, group block default alignment, columns block default alignment, image block left alignment' => array(
11121112
'',
11131113
'',
11141114
'left',
11151115
'sizes="(max-width: 413px) 100vw, 413px" ',
11161116
),
1117-
'Return 66.66% width of contentSize 413px, parent block default alignment, image block center alignment' => array(
1117+
'Return 66.66% width of contentSize 413px,group block default alignment, columns block default alignment, image block center alignment' => array(
11181118
'',
11191119
'',
11201120
'center',
11211121
'sizes="(max-width: 413px) 100vw, 413px" ',
11221122
),
1123-
'Return 66.66% width of contentSize 413px, parent block default alignment, image block right alignment' => array(
1123+
'Return 66.66% width of contentSize 413px, group block default alignment, columns block default alignment, image block right alignment' => array(
11241124
'',
11251125
'',
11261126
'right',
11271127
'sizes="(max-width: 413px) 100vw, 413px" ',
11281128
),
11291129

11301130
// Parent wide alignment.
1131-
'Return 66.66% width of contentSize 413px, parent block wide alignment, image block default alignment' => array(
1131+
'Return 66.66% width of contentSize 413px, group block wide alignment, columns block default alignment, image block default alignment' => array(
11321132
'wide',
11331133
'',
11341134
'',
11351135
'sizes="(max-width: 413px) 100vw, 413px" ',
11361136
),
1137-
'Return 66.66% width of contentSize 413px, parent block wide alignment, image block wide alignment' => array(
1137+
'Return 66.66% width of contentSize 413px, group block wide alignment, columns block default alignment, image block wide alignment' => array(
11381138
'wide',
11391139
'',
11401140
'wide',
11411141
'sizes="(max-width: 413px) 100vw, 413px" ',
11421142
),
1143-
'Return 66.66% width of contentSize 413px, parent block wide alignment, image block full alignment' => array(
1143+
'Return 66.66% width of contentSize 413px, group block wide alignment, columns block default alignment, image block full alignment' => array(
11441144
'wide',
11451145
'',
11461146
'full',
11471147
'sizes="(max-width: 413px) 100vw, 413px" ',
11481148
),
1149-
'Return 66.66% width of contentSize 413px, parent block wide alignment, image block left alignment' => array(
1149+
'Return 66.66% width of contentSize 413px, group block wide alignment, columns block default alignment, image block left alignment' => array(
11501150
'wide',
11511151
'',
11521152
'left',
11531153
'sizes="(max-width: 413px) 100vw, 413px" ',
11541154
),
1155-
'Return 66.66% width of contentSize 413px, parent block wide alignment, image block center alignment' => array(
1155+
'Return 66.66% width of contentSize 413px, group block wide alignment, columns block default alignment, image block center alignment' => array(
11561156
'wide',
11571157
'',
11581158
'center',
11591159
'sizes="(max-width: 413px) 100vw, 413px" ',
11601160
),
1161-
'Return 66.66% width of contentSize 413px, parent block wide alignment, image block right alignment' => array(
1161+
'Return 66.66% width of contentSize 413px, group block wide alignment, columns block default alignment, image block right alignment' => array(
11621162
'wide',
11631163
'',
11641164
'right',
11651165
'sizes="(max-width: 413px) 100vw, 413px" ',
11661166
),
11671167

11681168
// Parent full alignment.
1169-
'Return 66.66% width of contentSize 413px, parent block full alignment, image block default alignment' => array(
1169+
'Return 66.66% width of contentSize 413px, group block full alignment, columns block default alignment, image block default alignment' => array(
11701170
'full',
11711171
'',
11721172
'',
11731173
'sizes="(max-width: 413px) 100vw, 413px" ',
11741174
),
1175-
'Return 66.66% width of contentSize 413px, parent block full alignment, image block wide alignment' => array(
1175+
'Return 66.66% width of contentSize 413px, group block full alignment, columns block default alignment, image block wide alignment' => array(
11761176
'full',
11771177
'',
11781178
'wide',
11791179
'sizes="(max-width: 413px) 100vw, 413px" ',
11801180
),
1181-
'Return 66.66% width of contentSize 413px, parent block full alignment, image block full alignment' => array(
1181+
'Return 66.66% width of contentSize 413px, group block full alignment, columns block default alignment, image block full alignment' => array(
11821182
'full',
11831183
'',
11841184
'full',
11851185
'sizes="(max-width: 413px) 100vw, 413px" ',
11861186
),
1187-
'Return 66.66% width of contentSize 413px, parent block full alignment, image block left alignment' => array(
1187+
'Return 66.66% width of contentSize 413px, group block full alignment, columns block default alignment, image block left alignment' => array(
11881188
'full',
11891189
'',
11901190
'left',
11911191
'sizes="(max-width: 413px) 100vw, 413px" ',
11921192
),
1193-
'Return 66.66% width of contentSize 413px, parent block full alignment, image block center alignment' => array(
1193+
'Return 66.66% width of contentSize 413px, group block full alignment, columns block default alignment, image block center alignment' => array(
11941194
'full',
11951195
'',
11961196
'center',
11971197
'sizes="(max-width: 413px) 100vw, 413px" ',
11981198
),
1199-
'Return 66.66% width of contentSize 413px, parent block full alignment, image block right alignment' => array(
1199+
'Return 66.66% width of contentSize 413px, group block full alignment, columns block default alignment, image block right alignment' => array(
12001200
'full',
12011201
'',
12021202
'right',
12031203
'sizes="(max-width: 413px) 100vw, 413px" ',
12041204
),
1205+
'Return 66.66% width of wideSize 853px, group block full alignment, columns block wide alignment, image block left alignment' => array(
1206+
'full',
1207+
'wide',
1208+
'left',
1209+
'sizes="(max-width: 853px) 100vw, 853px" ',
1210+
),
1211+
'Return 66.66% width of contentSize 413px, group block full alignment, columns block wide alignment, image block center alignment' => array(
1212+
'full',
1213+
'wide',
1214+
'center',
1215+
'sizes="(max-width: 413px) 100vw, 413px" ',
1216+
),
1217+
'Return 66.66% width of wideSize 853px, group block full alignment, columns block wide alignment, image block right alignment' => array(
1218+
'full',
1219+
'wide',
1220+
'right',
1221+
'sizes="(max-width: 853px) 100vw, 853px" ',
1222+
),
1223+
'Return 66.66% width of wideSize 853px, group block wide alignment, columns block wide alignment, image block left alignment' => array(
1224+
'wide',
1225+
'wide',
1226+
'left',
1227+
'sizes="(max-width: 853px) 100vw, 853px" ',
1228+
),
1229+
'Return 66.66% width of contentSize 413px, group block wide alignment, columns block wide alignment, image block center alignment' => array(
1230+
'wide',
1231+
'wide',
1232+
'center',
1233+
'sizes="(max-width: 413px) 100vw, 413px" ',
1234+
),
1235+
'Return 66.66% width of wideSize 853px, group block wide alignment, columns block wide alignment, image block right alignment' => array(
1236+
'wide',
1237+
'wide',
1238+
'right',
1239+
'sizes="(max-width: 853px) 100vw, 853px" ',
1240+
),
1241+
'Return 66.66% width of wideSize 853px, group block full alignment, columns block full alignment, image block left alignment' => array(
1242+
'full',
1243+
'full',
1244+
'left',
1245+
'sizes="(max-width: 853px) 100vw, 853px" ',
1246+
),
1247+
'Return 66.66% width of contentSize 413px, group block full alignment, columns block full alignment, image block center alignment' => array(
1248+
'full',
1249+
'full',
1250+
'center',
1251+
'sizes="(max-width: 413px) 100vw, 413px" ',
1252+
),
1253+
'Return 66.66% width of wideSize 853px, group block full alignment, columns block full alignment, image block right alignment' => array(
1254+
'full',
1255+
'full',
1256+
'right',
1257+
'sizes="(max-width: 853px) 100vw, 853px" ',
1258+
),
12051259
);
12061260
}
12071261

0 commit comments

Comments
 (0)