1010 * @group block-bindings
1111 */
1212class Tests_Blocks_wpBlockBindingsProcessor extends WP_UnitTestCase {
13+
14+ private static $ get_block_bindings_processor_method ;
15+
16+ public static function wpSetupBeforeClass () {
17+ self ::$ get_block_bindings_processor_method = new ReflectionMethod ( 'WP_Block ' , 'get_block_bindings_processor ' );
18+ self ::$ get_block_bindings_processor_method ->setAccessible ( true );
19+ }
20+
1321 /**
1422 * @ticket 63840
1523 */
1624 public function test_replace_rich_text () {
1725 $ button_wrapper_opener = '<div class="wp-block-button"><a class="wp-block-button__link wp-element-button"> ' ;
1826 $ button_wrapper_closer = '</a></div> ' ;
19- $ processor = WP_Block_Bindings_Processor::create_fragment (
27+
28+ $ processor = self ::$ get_block_bindings_processor_method ->invoke (
29+ null ,
2030 $ button_wrapper_opener . 'This should not appear ' . $ button_wrapper_closer
2131 );
2232 $ processor ->next_tag ( array ( 'tag_name ' => 'a ' ) );
@@ -35,7 +45,8 @@ public function test_set_attribute_and_replace_rich_text() {
3545 $ figure_opener = '<figure class="wp-block-image"> ' ;
3646 $ img = '<img src="breakfast.jpg" alt="" class="wp-image-1"/> ' ;
3747 $ figure_closer = '</figure> ' ;
38- $ processor = WP_Block_Bindings_Processor::create_fragment (
48+ $ processor = self ::$ get_block_bindings_processor_method ->invoke (
49+ null ,
3950 $ figure_opener .
4051 $ img .
4152 '<figcaption class="wp-element-caption">Breakfast at a <em>café</em> in Berlin</figcaption> ' .
@@ -64,7 +75,8 @@ public function test_replace_rich_text_and_seek() {
6475 $ figure_opener = '<figure class="wp-block-image"> ' ;
6576 $ img = '<img src="breakfast.jpg" alt="" class="wp-image-1"/> ' ;
6677 $ figure_closer = '</figure> ' ;
67- $ processor = WP_Block_Bindings_Processor::create_fragment (
78+ $ processor = self ::$ get_block_bindings_processor_method ->invoke (
79+ null ,
6880 $ figure_opener .
6981 $ img .
7082 '<figcaption class="wp-element-caption">Breakfast at a <em>café</em> in Berlin</figcaption> ' .
0 commit comments