Changeset 53153 for trunk/tests/phpunit/tests/block-supports/colors.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/colors.php
r53128 r53153 5 5 class Tests_Block_Supports_Colors 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 54337 8 24 * … … 10 26 */ 11 27 function test_color_slugs_with_numbers_are_kebab_cased_properly() { 28 $this->test_block_name = 'test/color-slug-with-numbers'; 12 29 register_block_type( 13 'test/color-slug-with-numbers',30 $this->test_block_name, 14 31 array( 15 32 'api_version' => 2, … … 35 52 ); 36 53 $registry = WP_Block_Type_Registry::get_instance(); 37 $block_type = $registry->get_registered( 'test/color-slug-with-numbers');54 $block_type = $registry->get_registered( $this->test_block_name ); 38 55 39 56 $block_atts = array( … … 47 64 48 65 $this->assertSame( $expected, $actual ); 49 unregister_block_type( 'test/color-slug-with-numbers' );50 66 } 51 67 … … 56 72 */ 57 73 function test_color_with_skipped_serialization_block_supports() { 58 $ block_name = 'test/color-with-skipped-serialization-block-supports';74 $this->test_block_name = 'test/color-with-skipped-serialization-block-supports'; 59 75 register_block_type( 60 $ block_name,76 $this->test_block_name, 61 77 array( 62 78 'api_version' => 2, … … 77 93 78 94 $registry = WP_Block_Type_Registry::get_instance(); 79 $block_type = $registry->get_registered( $ block_name );95 $block_type = $registry->get_registered( $this->test_block_name ); 80 96 $block_atts = array( 81 97 'style' => array( … … 91 107 92 108 $this->assertSame( $expected, $actual ); 93 unregister_block_type( $block_name );94 109 } 95 110 … … 100 115 */ 101 116 function test_gradient_with_individual_skipped_serialization_block_supports() { 102 $ block_name = 'test/gradient-with-individual-skipped-serialization-block-support';117 $this->test_block_name = 'test/gradient-with-individual-skipped-serialization-block-support'; 103 118 register_block_type( 104 $ block_name,119 $this->test_block_name, 105 120 array( 106 121 'api_version' => 2, … … 121 136 122 137 $registry = WP_Block_Type_Registry::get_instance(); 123 $block_type = $registry->get_registered( $ block_name );138 $block_type = $registry->get_registered( $this->test_block_name ); 124 139 $block_atts = array( 125 140 'style' => array( … … 137 152 138 153 $this->assertSame( $expected, $actual ); 139 unregister_block_type( $block_name );140 154 } 141 155 }
Note: See TracChangeset
for help on using the changeset viewer.