- Timestamp:
- 09/14/2023 04:54:22 AM (12 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/style-engine/wpStyleEngineProcessor.php
r54394 r56574 82 82 $a_wonderful_processor->add_rules( array( $a_wonderful_css_rule, $a_very_wonderful_css_rule, $a_more_wonderful_css_rule ) ); 83 83 84 $expected = '.a-more-wonderful-rule { 84 $expected = '.a-wonderful-rule { 85 color: var(--wonderful-color); 86 background-color: orange; 87 } 88 .a-very_wonderful-rule { 89 color: var(--wonderful-color); 90 background-color: orange; 91 } 92 .a-more-wonderful-rule { 85 93 font-family: Wonderful sans; 86 94 font-size: 1em; 87 background-color: orange;88 }89 .a-wonderful-rule,90 .a-very_wonderful-rule {91 color: var(--wonderful-color);92 95 background-color: orange; 93 96 } … … 185 188 * Tests printing out 'unoptimized' CSS, that is, uncombined selectors and duplicate CSS rules. 186 189 * 190 * This is the default. 191 * 192 * @ticket 58811 187 193 * @ticket 56467 188 194 * … … 231 237 * Tests that 'optimized' CSS is output, that is, that duplicate CSS rules are combined under their corresponding selectors. 232 238 * 233 * @ticket 56467 234 * 235 * @covers ::get_css 236 */ 237 public function test_should_optimize_css_output_by_default() { 239 * @ticket 58811 240 * @ticket 56467 241 * 242 * @covers ::get_css 243 */ 244 public function test_should_not_optimize_css_output_by_default() { 238 245 $a_sweet_rule = new WP_Style_Engine_CSS_Rule( 239 246 '.a-sweet-rule', … … 256 263 257 264 $this->assertSame( 258 '.a-sweet-rule ,#an-even-sweeter-rule > marquee{color:var(--sweet-color);background-color:purple;}',265 '.a-sweet-rule{color:var(--sweet-color);background-color:purple;}#an-even-sweeter-rule > marquee{color:var(--sweet-color);background-color:purple;}', 259 266 $a_sweet_processor->get_css( array( 'prettify' => false ) ) 260 267 ); … … 262 269 263 270 /** 264 * Tests that incoming CSS rules are merged with existing CSS rules. 265 * 271 * Tests that incoming CSS rules are optimized and merged with existing CSS rules. 272 * 273 * @ticket 58811 266 274 * @ticket 56467 267 275 * … … 287 295 $this->assertSame( 288 296 '.a-lovely-rule,.a-lovelier-rule{border-color:purple;}', 289 $a_lovely_processor->get_css( array( 'prettify' => false ) ), 297 $a_lovely_processor->get_css( 298 array( 299 'prettify' => false, 300 'optimize' => true, 301 ) 302 ), 290 303 'Return value of get_css() does not match expectations when combining 2 CSS rules' 291 304 ); … … 309 322 $this->assertSame( 310 323 '.a-lovely-rule,.a-lovelier-rule,.a-most-lovely-rule,.a-perfectly-lovely-rule{border-color:purple;}', 311 $a_lovely_processor->get_css( array( 'prettify' => false ) ), 324 $a_lovely_processor->get_css( 325 array( 326 'prettify' => false, 327 'optimize' => true, 328 ) 329 ), 312 330 'Return value of get_css() does not match expectations when combining 4 CSS rules' 313 331 );
Note: See TracChangeset
for help on using the changeset viewer.