Changeset 53153 for trunk/tests/phpunit/tests/block-supports/border.php
- Timestamp:
- 04/12/2022 09:38:18 AM (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/block-supports/border.php
r53128 r53153 5 5 class Test_Block_Supports_Border extends WP_UnitTestCase { 6 6 /** 7 * @var string|null 8 */ 9 private $test_block_name; 10 11 function set_up() { 12 parent::set_up(); 13 $this->test_block_name = null; 14 } 15 16 function tear_down() { 17 unregister_block_type( $this->test_block_name ); 18 $this->test_block_name = null; 19 parent::set_up(); 20 } 21 22 /** 7 23 * @ticket 55505 8 24 * … … 10 26 */ 11 27 function test_border_color_slug_with_numbers_is_kebab_cased_properly() { 12 $ block_name = 'test/border-color-slug-with-numbers-is-kebab-cased-properly';28 $this->test_block_name = 'test/border-color-slug-with-numbers-is-kebab-cased-properly'; 13 29 register_block_type( 14 $ block_name,30 $this->test_block_name, 15 31 array( 16 32 'api_version' => 2, … … 34 50 ); 35 51 $registry = WP_Block_Type_Registry::get_instance(); 36 $block_type = $registry->get_registered( $ block_name );52 $block_type = $registry->get_registered( $this->test_block_name ); 37 53 $block_atts = array( 38 54 'borderColor' => 'red', … … 53 69 54 70 $this->assertSame( $expected, $actual ); 55 unregister_block_type( $block_name );56 71 } 57 72 … … 62 77 */ 63 78 function test_border_with_skipped_serialization_block_supports() { 64 $ block_name = 'test/border-with-skipped-serialization-block-supports';79 $this->test_block_name = 'test/border-with-skipped-serialization-block-supports'; 65 80 register_block_type( 66 $ block_name,81 $this->test_block_name, 67 82 array( 68 83 'api_version' => 2, … … 84 99 ); 85 100 $registry = WP_Block_Type_Registry::get_instance(); 86 $block_type = $registry->get_registered( $ block_name );101 $block_type = $registry->get_registered( $this->test_block_name ); 87 102 $block_atts = array( 88 103 'style' => array( … … 100 115 101 116 $this->assertSame( $expected, $actual ); 102 unregister_block_type( $block_name );103 117 } 104 118 … … 109 123 */ 110 124 function test_radius_with_individual_skipped_serialization_block_supports() { 111 $ block_name = 'test/radius-with-individual-skipped-serialization-block-supports';125 $this->test_block_name = 'test/radius-with-individual-skipped-serialization-block-supports'; 112 126 register_block_type( 113 $ block_name,127 $this->test_block_name, 114 128 array( 115 129 'api_version' => 2, … … 131 145 ); 132 146 $registry = WP_Block_Type_Registry::get_instance(); 133 $block_type = $registry->get_registered( $ block_name );147 $block_type = $registry->get_registered( $this->test_block_name ); 134 148 $block_atts = array( 135 149 'style' => array( … … 149 163 150 164 $this->assertSame( $expected, $actual ); 151 unregister_block_type( $block_name );152 165 } 153 166 }
Note: See TracChangeset
for help on using the changeset viewer.