Changeset 52232 for trunk/tests/phpunit/tests/theme/wpThemeJson.php
- Timestamp:
- 11/23/2021 05:38:45 AM (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/theme/wpThemeJson.php
r52049 r52232 77 77 */ 78 78 public function test_get_settings_presets_are_keyed_by_origin() { 79 $ core_origin = new WP_Theme_JSON(79 $default_origin = new WP_Theme_JSON( 80 80 array( 81 81 'version' => WP_Theme_JSON::LATEST_SCHEMA, … … 104 104 ), 105 105 ), 106 ' core'107 ); 108 $no_origin = new WP_Theme_JSON(106 'default' 107 ); 108 $no_origin = new WP_Theme_JSON( 109 109 array( 110 110 'version' => WP_Theme_JSON::LATEST_SCHEMA, … … 135 135 ); 136 136 137 $actual_ core = $core_origin->get_raw_data();137 $actual_default = $default_origin->get_raw_data(); 138 138 $actual_no_origin = $no_origin->get_raw_data(); 139 139 140 $expected_ core= array(140 $expected_default = array( 141 141 'version' => WP_Theme_JSON::LATEST_SCHEMA, 142 142 'settings' => array( 143 143 'color' => array( 144 144 'palette' => array( 145 ' core' => array(145 'default' => array( 146 146 array( 147 147 'slug' => 'white', … … 155 155 'color' => array( 156 156 'palette' => array( 157 ' core' => array(157 'default' => array( 158 158 array( 159 159 'slug' => 'white', … … 197 197 ); 198 198 199 $this->assertEqualSetsWithIndex( $expected_ core, $actual_core);199 $this->assertEqualSetsWithIndex( $expected_default, $actual_default ); 200 200 $this->assertEqualSetsWithIndex( $expected_no_origin, $actual_no_origin ); 201 201 } … … 594 594 ), 595 595 ), 596 ' core'596 'default' 597 597 ); 598 598 … … 1299 1299 'custom' => true, 1300 1300 'palette' => array( 1301 array( 1302 'name' => 'Red', 1303 'slug' => 'red', 1304 'color' => '#ff0000', 1305 ), 1306 array( 1307 'name' => 'Green', 1308 'slug' => 'green', 1309 'color' => '#00ff00', 1310 ), 1311 array( 1312 'name' => 'Blue', 1313 'slug' => 'blue', 1314 'color' => '#0000ff', 1301 'user' => array( 1302 array( 1303 'name' => 'Red', 1304 'slug' => 'red', 1305 'color' => '#ff0000', 1306 ), 1307 array( 1308 'name' => 'Green', 1309 'slug' => 'green', 1310 'color' => '#00ff00', 1311 ), 1312 array( 1313 'name' => 'Blue', 1314 'slug' => 'blue', 1315 'color' => '#0000ff', 1316 ), 1315 1317 ), 1316 1318 ), … … 1324 1326 'custom' => true, 1325 1327 'palette' => array( 1328 'user' => array( 1329 array( 1330 'name' => 'Yellow', 1331 'slug' => 'yellow', 1332 'color' => '#ff0000', 1333 ), 1334 array( 1335 'name' => 'Pink', 1336 'slug' => 'pink', 1337 'color' => '#00ff00', 1338 ), 1339 array( 1340 'name' => 'Orange', 1341 'slug' => 'orange', 1342 'color' => '#0000ff', 1343 ), 1344 ), 1345 ), 1346 ), 1347 'spacing' => array( 1348 'padding' => false, 1349 ), 1350 ), 1351 ), 1352 ), 1353 ) 1354 ); 1355 1356 $expected = array( 1357 'version' => WP_Theme_JSON::LATEST_SCHEMA, 1358 'settings' => array( 1359 'color' => array( 1360 'palette' => array( 1361 'user' => array( 1362 array( 1363 'name' => 'Red', 1364 'slug' => 'red', 1365 'color' => '#ff0000', 1366 ), 1367 array( 1368 'name' => 'Green', 1369 'slug' => 'green', 1370 'color' => '#00ff00', 1371 ), 1372 array( 1373 'name' => 'Blue', 1374 'slug' => 'blue', 1375 'color' => '#0000ff', 1376 ), 1377 ), 1378 ), 1379 ), 1380 'blocks' => array( 1381 'core/group' => array( 1382 'color' => array( 1383 'palette' => array( 1384 'user' => array( 1326 1385 array( 1327 1386 'name' => 'Yellow', … … 1341 1400 ), 1342 1401 ), 1343 'spacing' => array(1344 'padding' => false,1345 ),1346 ),1347 ),1348 ),1349 )1350 );1351 1352 $expected = array(1353 'version' => WP_Theme_JSON::LATEST_SCHEMA,1354 'settings' => array(1355 'color' => array(1356 'palette' => array(1357 array(1358 'name' => 'Red',1359 'slug' => 'red',1360 'color' => '#ff0000',1361 ),1362 array(1363 'name' => 'Green',1364 'slug' => 'green',1365 'color' => '#00ff00',1366 ),1367 array(1368 'name' => 'Blue',1369 'slug' => 'blue',1370 'color' => '#0000ff',1371 ),1372 ),1373 ),1374 'blocks' => array(1375 'core/group' => array(1376 'color' => array(1377 'palette' => array(1378 array(1379 'name' => 'Yellow',1380 'slug' => 'yellow',1381 'color' => '#ff0000',1382 ),1383 array(1384 'name' => 'Pink',1385 'slug' => 'pink',1386 'color' => '#00ff00',1387 ),1388 array(1389 'name' => 'Orange',1390 'slug' => 'orange',1391 'color' => '#0000ff',1392 ),1393 ),1394 1402 ), 1395 1403 ), … … 1410 1418 'color' => array( 1411 1419 'palette' => array( 1412 array( 1413 'name' => 'Red/><b>ok</ok>', 1414 'slug' => 'red', 1415 'color' => '#ff0000', 1416 ), 1417 array( 1418 'name' => 'Green', 1419 'slug' => 'a" attr', 1420 'color' => '#00ff00', 1421 ), 1422 array( 1423 'name' => 'Blue', 1424 'slug' => 'blue', 1425 'color' => 'var(--color, var(--unsafe-fallback))', 1426 ), 1427 array( 1428 'name' => 'Pink', 1429 'slug' => 'pink', 1430 'color' => '#FFC0CB', 1420 'user' => array( 1421 array( 1422 'name' => 'Red/><b>ok</ok>', 1423 'slug' => 'red', 1424 'color' => '#ff0000', 1425 ), 1426 array( 1427 'name' => 'Green', 1428 'slug' => 'a" attr', 1429 'color' => '#00ff00', 1430 ), 1431 array( 1432 'name' => 'Blue', 1433 'slug' => 'blue', 1434 'color' => 'var(--color, var(--unsafe-fallback))', 1435 ), 1436 array( 1437 'name' => 'Pink', 1438 'slug' => 'pink', 1439 'color' => '#FFC0CB', 1440 ), 1431 1441 ), 1432 1442 ), … … 1434 1444 'typography' => array( 1435 1445 'fontFamilies' => array( 1436 array( 1437 'name' => 'Helvetica Arial/><b>test</b>', 1438 'slug' => 'helvetica-arial', 1439 'fontFamily' => 'Helvetica Neue, Helvetica, Arial, sans-serif', 1440 ), 1441 array( 1442 'name' => 'Geneva', 1443 'slug' => 'geneva#asa', 1444 'fontFamily' => 'Geneva, Tahoma, Verdana, sans-serif', 1445 ), 1446 array( 1447 'name' => 'Cambria', 1448 'slug' => 'cambria', 1449 'fontFamily' => 'Cambria, Georgia, serif', 1450 ), 1451 array( 1452 'name' => 'Helvetica Arial', 1453 'slug' => 'helvetica-arial', 1454 'fontFamily' => 'var(--fontFamily, var(--unsafe-fallback))', 1446 'user' => array( 1447 array( 1448 'name' => 'Helvetica Arial/><b>test</b>', 1449 'slug' => 'helvetica-arial', 1450 'fontFamily' => 'Helvetica Neue, Helvetica, Arial, sans-serif', 1451 ), 1452 array( 1453 'name' => 'Geneva', 1454 'slug' => 'geneva#asa', 1455 'fontFamily' => 'Geneva, Tahoma, Verdana, sans-serif', 1456 ), 1457 array( 1458 'name' => 'Cambria', 1459 'slug' => 'cambria', 1460 'fontFamily' => 'Cambria, Georgia, serif', 1461 ), 1462 array( 1463 'name' => 'Helvetica Arial', 1464 'slug' => 'helvetica-arial', 1465 'fontFamily' => 'var(--fontFamily, var(--unsafe-fallback))', 1466 ), 1455 1467 ), 1456 1468 ), … … 1460 1472 'color' => array( 1461 1473 'palette' => array( 1462 array( 1463 'name' => 'Red/><b>ok</ok>', 1464 'slug' => 'red', 1465 'color' => '#ff0000', 1474 'user' => array( 1475 array( 1476 'name' => 'Red/><b>ok</ok>', 1477 'slug' => 'red', 1478 'color' => '#ff0000', 1479 ), 1480 array( 1481 'name' => 'Green', 1482 'slug' => 'a" attr', 1483 'color' => '#00ff00', 1484 ), 1485 array( 1486 'name' => 'Blue', 1487 'slug' => 'blue', 1488 'color' => 'var(--color, var(--unsafe--fallback))', 1489 ), 1490 array( 1491 'name' => 'Pink', 1492 'slug' => 'pink', 1493 'color' => '#FFC0CB', 1494 ), 1466 1495 ), 1467 array( 1468 'name' => 'Green', 1469 'slug' => 'a" attr', 1470 'color' => '#00ff00', 1471 ), 1472 array( 1473 'name' => 'Blue', 1474 'slug' => 'blue', 1475 'color' => 'var(--color, var(--unsafe--fallback))', 1476 ), 1496 ), 1497 ), 1498 ), 1499 ), 1500 ), 1501 ) 1502 ); 1503 1504 $expected = array( 1505 'version' => WP_Theme_JSON::LATEST_SCHEMA, 1506 'settings' => array( 1507 'color' => array( 1508 'palette' => array( 1509 'user' => array( 1510 array( 1511 'name' => 'Pink', 1512 'slug' => 'pink', 1513 'color' => '#FFC0CB', 1514 ), 1515 ), 1516 ), 1517 ), 1518 'typography' => array( 1519 'fontFamilies' => array( 1520 'user' => array( 1521 array( 1522 'name' => 'Cambria', 1523 'slug' => 'cambria', 1524 'fontFamily' => 'Cambria, Georgia, serif', 1525 ), 1526 ), 1527 ), 1528 ), 1529 'blocks' => array( 1530 'core/group' => array( 1531 'color' => array( 1532 'palette' => array( 1533 'user' => array( 1477 1534 array( 1478 1535 'name' => 'Pink', … … 1480 1537 'color' => '#FFC0CB', 1481 1538 ), 1482 ),1483 ),1484 ),1485 ),1486 ),1487 )1488 );1489 1490 $expected = array(1491 'version' => WP_Theme_JSON::LATEST_SCHEMA,1492 'settings' => array(1493 'color' => array(1494 'palette' => array(1495 array(1496 'name' => 'Pink',1497 'slug' => 'pink',1498 'color' => '#FFC0CB',1499 ),1500 ),1501 ),1502 'typography' => array(1503 'fontFamilies' => array(1504 array(1505 'name' => 'Cambria',1506 'slug' => 'cambria',1507 'fontFamily' => 'Cambria, Georgia, serif',1508 ),1509 ),1510 ),1511 'blocks' => array(1512 'core/group' => array(1513 'color' => array(1514 'palette' => array(1515 array(1516 'name' => 'Pink',1517 'slug' => 'pink',1518 'color' => '#FFC0CB',1519 1539 ), 1520 1540 ),
Note: See TracChangeset
for help on using the changeset viewer.