Changeset 52401 for trunk/tests/phpunit/tests/theme/wpThemeJson.php
- Timestamp:
- 12/21/2021 06:00:34 AM (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/theme/wpThemeJson.php
r52364 r52401 1482 1482 1483 1483 $this->assertEqualSetsWithIndex( $expected, $actual ); 1484 } 1485 1486 /** 1487 * @ticket 54640 1488 */ 1489 public function test_merge_incoming_data_presets_use_default_names() { 1490 $defaults = new WP_Theme_JSON( 1491 array( 1492 'version' => WP_Theme_JSON::LATEST_SCHEMA, 1493 'settings' => array( 1494 'typography' => array( 1495 'fontSizes' => array( 1496 array( 1497 'name' => 'Small', 1498 'slug' => 'small', 1499 'size' => '12px', 1500 ), 1501 array( 1502 'name' => 'Large', 1503 'slug' => 'large', 1504 'size' => '20px', 1505 ), 1506 ), 1507 ), 1508 ), 1509 ), 1510 'default' 1511 ); 1512 $theme_json = new WP_Theme_JSON( 1513 array( 1514 'version' => WP_Theme_JSON::LATEST_SCHEMA, 1515 'settings' => array( 1516 'typography' => array( 1517 'fontSizes' => array( 1518 array( 1519 'slug' => 'small', 1520 'size' => '1.1rem', 1521 ), 1522 array( 1523 'slug' => 'large', 1524 'size' => '1.75rem', 1525 ), 1526 array( 1527 'name' => 'Huge', 1528 'slug' => 'huge', 1529 'size' => '3rem', 1530 ), 1531 ), 1532 ), 1533 ), 1534 ), 1535 'theme' 1536 ); 1537 $expected = array( 1538 'version' => WP_Theme_JSON::LATEST_SCHEMA, 1539 'settings' => array( 1540 'typography' => array( 1541 'fontSizes' => array( 1542 'default' => array( 1543 array( 1544 'name' => 'Small', 1545 'slug' => 'small', 1546 'size' => '12px', 1547 ), 1548 array( 1549 'name' => 'Large', 1550 'slug' => 'large', 1551 'size' => '20px', 1552 ), 1553 ), 1554 'theme' => array( 1555 array( 1556 'slug' => 'small', 1557 'size' => '1.1rem', 1558 'name' => 'Small', 1559 ), 1560 array( 1561 'slug' => 'large', 1562 'size' => '1.75rem', 1563 'name' => 'Large', 1564 ), 1565 array( 1566 'name' => 'Huge', 1567 'slug' => 'huge', 1568 'size' => '3rem', 1569 ), 1570 ), 1571 ), 1572 ), 1573 ), 1574 ); 1575 $defaults->merge( $theme_json ); 1576 $actual = $defaults->get_raw_data(); 1577 $this->assertSameSetsWithIndex( $expected, $actual ); 1484 1578 } 1485 1579
Note: See TracChangeset
for help on using the changeset viewer.