Changeset 56382 for trunk/tests/phpunit/tests/blocks/wpBlock.php
- Timestamp:
- 08/10/2023 04:47:00 PM (23 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/blocks/wpBlock.php
r55822 r56382 684 684 685 685 /** 686 * @ticket 58532 687 * 688 * @dataProvider data_block_has_support_string 689 * 690 * @param array $block_data Block data. 691 * @param string $support Support string to check. 692 * @param bool $expected Expected result. 693 */ 694 public function test_block_has_support_string( $block_data, $support, $expected, $message ) { 695 $this->registry->register( 'core/example', $block_data ); 696 $block_type = $this->registry->get_registered( 'core/example' ); 697 $has_support = block_has_support( $block_type, $support ); 698 $this->assertEquals( $expected, $has_support, $message ); 699 } 700 701 /** 702 * Data provider for test_block_has_support_string 703 */ 704 public function data_block_has_support_string() { 705 return array( 706 array( 707 array(), 708 'color', 709 false, 710 'Block with empty support array.', 711 ), 712 array( 713 array( 714 'supports' => array( 715 'align' => array( 'wide', 'full' ), 716 'fontSize' => true, 717 'color' => array( 718 'link' => true, 719 'gradient' => false, 720 ), 721 ), 722 ), 723 'align', 724 true, 725 'Feature present in support array.', 726 ), 727 array( 728 array( 729 'supports' => array( 730 'align' => array( 'wide', 'full' ), 731 'fontSize' => true, 732 'color' => array( 733 'link' => true, 734 'gradient' => false, 735 ), 736 ), 737 ), 738 'anchor', 739 false, 740 'Feature not present in support array.', 741 ), 742 array( 743 array( 744 'supports' => array( 745 'align' => array( 'wide', 'full' ), 746 'fontSize' => true, 747 'color' => array( 748 'link' => true, 749 'gradient' => false, 750 ), 751 ), 752 ), 753 array( 'align' ), 754 true, 755 'Feature present in support array, single element array.', 756 ), 757 ); 758 } 759 760 /** 686 761 * @ticket 51612 687 762 */
Note: See TracChangeset
for help on using the changeset viewer.