Changeset 54646 for trunk/tests/phpunit/tests/block-supports/typography.php
- Timestamp:
- 10/19/2022 12:25:21 PM (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/block-supports/typography.php
r54497 r54646 364 364 'default_return_value_when_value_is_already_clamped' => array( 365 365 'font_size_preset' => array( 366 'size' => 'clamp(21px, 1.31 25rem + ((1vw - 7.68px) * 2.524), 42px)',366 'size' => 'clamp(21px, 1.313rem + ((1vw - 7.68px) * 2.524), 42px)', 367 367 'fluid' => false, 368 368 ), 369 369 'should_use_fluid_typography' => true, 370 'expected_output' => 'clamp(21px, 1.31 25rem + ((1vw - 7.68px) * 2.524), 42px)',370 'expected_output' => 'clamp(21px, 1.313rem + ((1vw - 7.68px) * 2.524), 42px)', 371 371 ), 372 372 … … 385 385 ), 386 386 'should_use_fluid_typography' => true, 387 'expected_output' => 'clamp(1.31 25rem, 1.3125rem + ((1vw - 0.48rem) * 2.524), 2.625rem)',387 'expected_output' => 'clamp(1.313rem, 1.313rem + ((1vw - 0.48rem) * 2.523), 2.625rem)', 388 388 ), 389 389 … … 393 393 ), 394 394 'should_use_fluid_typography' => true, 395 'expected_output' => 'clamp(75.131 25px, 4.695703125rem + ((1vw - 7.68px) * 9.03), 150.2625px)',395 'expected_output' => 'clamp(75.131px, 4.696rem + ((1vw - 7.68px) * 9.03), 150.263px)', 396 396 ), 397 397 … … 401 401 ), 402 402 'should_use_fluid_typography' => true, 403 'expected_output' => 'clamp(24.75px, 1.54 6875rem + ((1vw - 7.68px) * 2.975), 49.5px)',403 'expected_output' => 'clamp(24.75px, 1.547rem + ((1vw - 7.68px) * 2.975), 49.5px)', 404 404 ), 405 405 … … 409 409 ), 410 410 'should_use_fluid_typography' => true, 411 'expected_output' => 'clamp(75.17 25px, 4.69828125rem + ((1vw - 7.68px) * 9.035), 150.345px)',411 'expected_output' => 'clamp(75.173px, 4.698rem + ((1vw - 7.68px) * 9.035), 150.345px)', 412 412 ), 413 413 … … 418 418 ), 419 419 'should_use_fluid_typography' => true, 420 'expected_output' => 'clamp(21px, 1.31 25rem + ((1vw - 7.68px) * 2.524), 42px)',420 'expected_output' => 'clamp(21px, 1.313rem + ((1vw - 7.68px) * 2.524), 42px)', 421 421 ), 422 422 … … 427 427 ), 428 428 'should_use_fluid_typography' => true, 429 'expected_output' => 'clamp(21px, 1.3125rem + ((1vw - 7.68px) * 2.524), 42px)', 429 'expected_output' => 'clamp(21px, 1.313rem + ((1vw - 7.68px) * 2.524), 42px)', 430 ), 431 432 'return_clamped_value_if_min_font_size_is_greater_than_max' => array( 433 'font_size_preset' => array( 434 'size' => '3rem', 435 'fluid' => array( 436 'min' => '5rem', 437 'max' => '32px', 438 ), 439 ), 440 'should_use_fluid_typography' => true, 441 'expected_output' => 'clamp(5rem, 5rem + ((1vw - 0.48rem) * -5.769), 32px)', 430 442 ), 431 443 … … 442 454 ), 443 455 444 'return_fluid_clamp_value' => array( 456 'return_clamped_size_where_no_min_is_given_and_less_than_default_min_size' => array( 457 'font_size_preset' => array( 458 'size' => '3px', 459 ), 460 'should_use_fluid_typography' => true, 461 'expected_output' => 'clamp(3px, 0.188rem + ((1vw - 7.68px) * 0.18), 4.5px)', 462 ), 463 464 'return_fluid_clamp_value_with_different_min_max_units' => array( 445 465 'font_size_preset' => array( 446 466 'size' => '28px', … … 473 493 ), 474 494 'should_use_fluid_typography' => true, 475 'expected_output' => 'clamp(21px, 1.3125rem + ((1vw - 7.68px) * 7.091), 80px)', 495 'expected_output' => 'clamp(21px, 1.313rem + ((1vw - 7.68px) * 7.091), 80px)', 496 ), 497 498 'should_adjust_computed_min_in_px_to_min_limit' => array( 499 'font_size_preset' => array( 500 'size' => '14px', 501 ), 502 'should_use_fluid_typography' => true, 503 'expected_output' => 'clamp(14px, 0.875rem + ((1vw - 7.68px) * 0.841), 21px)', 504 ), 505 506 'should_adjust_computed_min_in_rem_to_min_limit' => array( 507 'font_size_preset' => array( 508 'size' => '1.1rem', 509 ), 510 'should_use_fluid_typography' => true, 511 'expected_output' => 'clamp(0.875rem, 0.875rem + ((1vw - 0.48rem) * 1.49), 1.65rem)', 512 ), 513 514 'default_return_clamp_value_with_replaced_fluid_min_value_in_em' => array( 515 'font_size_preset' => array( 516 'size' => '1.1em', 517 ), 518 'should_use_fluid_typography' => true, 519 'expected_output' => 'clamp(0.875em, 0.875rem + ((1vw - 0.48em) * 1.49), 1.65em)', 520 ), 521 522 'should_adjust_fluid_min_value_in_px_to_min_limit' => array( 523 'font_size_preset' => array( 524 'size' => '20px', 525 'fluid' => array( 526 'min' => '12px', 527 ), 528 ), 529 'should_use_fluid_typography' => true, 530 'expected_output' => 'clamp(14px, 0.875rem + ((1vw - 7.68px) * 1.923), 30px)', 531 ), 532 533 'should_adjust_fluid_min_value_in_rem_to_min_limit' => array( 534 'font_size_preset' => array( 535 'size' => '1.5rem', 536 'fluid' => array( 537 'min' => '0.5rem', 538 ), 539 ), 540 'should_use_fluid_typography' => true, 541 'expected_output' => 'clamp(0.875rem, 0.875rem + ((1vw - 0.48rem) * 2.644), 2.25rem)', 542 ), 543 544 'should_adjust_fluid_min_value_but_honor_max_value' => array( 545 'font_size_preset' => array( 546 'size' => '1.5rem', 547 'fluid' => array( 548 'min' => '0.5rem', 549 'max' => '5rem', 550 ), 551 ), 552 'should_use_fluid_typography' => true, 553 'expected_output' => 'clamp(0.875rem, 0.875rem + ((1vw - 0.48rem) * 7.933), 5rem)', 554 ), 555 556 'should_return_fluid_value_when_min_and_max_font_sizes_are_equal' => array( 557 'font_size_preset' => array( 558 'size' => '4rem', 559 'fluid' => array( 560 'min' => '30px', 561 'max' => '30px', 562 ), 563 ), 564 'should_use_fluid_typography' => true, 565 'expected_output' => 'clamp(30px, 1.875rem + ((1vw - 7.68px) * 1), 30px)', 476 566 ), 477 567 ); … … 548 638 'font_size_value' => '50px', 549 639 'should_use_fluid_typography' => true, 550 'expected_output' => 'font-size:clamp(37.5px, 2.34 375rem + ((1vw - 7.68px) * 4.507), 75px);',640 'expected_output' => 'font-size:clamp(37.5px, 2.344rem + ((1vw - 7.68px) * 4.507), 75px);', 551 641 ), 552 642 ); … … 624 714 'font_size_value' => '20px', 625 715 'should_use_fluid_typography' => true, 626 'expected_output' => '<p class="has-medium-font-size" style=" font-size:clamp(15px, 0.93 75rem + ((1vw - 7.68px) * 1.803), 30px); ">A paragraph inside a group</p>',716 'expected_output' => '<p class="has-medium-font-size" style=" font-size:clamp(15px, 0.938rem + ((1vw - 7.68px) * 1.803), 30px); ">A paragraph inside a group</p>', 627 717 ), 628 718 'return_content_with_first_match_replace_only' => array( 629 'block_content' => "<div class=\"wp-block-group\" style=\"font-size:1 em\"> \n \n<p style=\"font-size:1em\">A paragraph inside a group</p></div>",630 'font_size_value' => '1 em',631 'should_use_fluid_typography' => true, 632 'expected_output' => "<div class=\"wp-block-group\" style=\"font-size:clamp( 0.75em, 0.75em + ((1vw - 0.48em) * 1.442), 1.5em);\"> \n \n<p style=\"font-size:1em\">A paragraph inside a group</p></div>",719 'block_content' => "<div class=\"wp-block-group\" style=\"font-size:1.5em\"> \n \n<p style=\"font-size:1.5em\">A paragraph inside a group</p></div>", 720 'font_size_value' => '1.5em', 721 'should_use_fluid_typography' => true, 722 'expected_output' => "<div class=\"wp-block-group\" style=\"font-size:clamp(1.125em, 1.125rem + ((1vw - 0.48em) * 2.163), 2.25em);\"> \n \n<p style=\"font-size:1.5em\">A paragraph inside a group</p></div>", 633 723 ), 634 724 );
Note: See TracChangeset
for help on using the changeset viewer.