Changeset 53153 for trunk/tests/phpunit/tests/block-supports/spacing.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/spacing.php
r53128 r53153 5 5 class Test_Block_Supports_Spacing 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_spacing_style_is_applied() { 12 $ block_name = 'test/spacing-style-is-applied';28 $this->test_block_name = 'test/spacing-style-is-applied'; 13 29 register_block_type( 14 $ block_name,30 $this->test_block_name, 15 31 array( 16 32 'api_version' => 2, … … 30 46 ); 31 47 $registry = WP_Block_Type_Registry::get_instance(); 32 $block_type = $registry->get_registered( $ block_name );48 $block_type = $registry->get_registered( $this->test_block_name ); 33 49 $block_atts = array( 34 50 'style' => array( … … 52 68 53 69 $this->assertSame( $expected, $actual ); 54 unregister_block_type( $block_name );55 70 } 56 71 … … 61 76 */ 62 77 function test_spacing_with_skipped_serialization_block_supports() { 63 $ block_name = 'test/spacing-with-skipped-serialization-block-supports';78 $this->test_block_name = 'test/spacing-with-skipped-serialization-block-supports'; 64 79 register_block_type( 65 $ block_name,80 $this->test_block_name, 66 81 array( 67 82 'api_version' => 2, … … 82 97 ); 83 98 $registry = WP_Block_Type_Registry::get_instance(); 84 $block_type = $registry->get_registered( $ block_name );99 $block_type = $registry->get_registered( $this->test_block_name ); 85 100 $block_atts = array( 86 101 'style' => array( … … 102 117 103 118 $this->assertSame( $expected, $actual ); 104 unregister_block_type( $block_name );105 119 } 106 120 … … 111 125 */ 112 126 function test_margin_with_individual_skipped_serialization_block_supports() { 113 $ block_name = 'test/margin-with-individual-skipped-serialization-block-supports';127 $this->test_block_name = 'test/margin-with-individual-skipped-serialization-block-supports'; 114 128 register_block_type( 115 $ block_name,129 $this->test_block_name, 116 130 array( 117 131 'api_version' => 2, … … 132 146 ); 133 147 $registry = WP_Block_Type_Registry::get_instance(); 134 $block_type = $registry->get_registered( $ block_name );148 $block_type = $registry->get_registered( $this->test_block_name ); 135 149 $block_atts = array( 136 150 'style' => array( … … 154 168 155 169 $this->assertSame( $expected, $actual ); 156 unregister_block_type( $block_name );157 170 } 158 171 }
Note: See TracChangeset
for help on using the changeset viewer.