Changeset 56620 for trunk/tests/phpunit/tests/blocks/serialize.php
- Timestamp:
- 09/19/2023 12:48:41 PM (18 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/blocks/serialize.php
r56557 r56620 14 14 /** 15 15 * @dataProvider data_serialize_identity_from_parsed 16 * 17 * @param string $original Original block markup. 16 18 */ 17 19 public function test_serialize_identity_from_parsed( $original ) { 18 20 $blocks = parse_blocks( $original ); 19 21 20 $actual = serialize_blocks( $blocks ); 21 $expected = $original; 22 $actual = serialize_blocks( $blocks ); 22 23 23 $this->assertSame( $ expected, $actual );24 $this->assertSame( $original, $actual ); 24 25 } 25 26 … … 59 60 * @ticket 59327 60 61 * 61 * @covers :: serialize_blocks62 * @covers ::traverse_and_serialize_blocks 62 63 */ 63 public function test_ callback_argument() {64 public function test_traverse_and_serialize_blocks() { 64 65 $markup = "<!-- wp:outer --><!-- wp:inner {\"key\":\"value\"} -->Example.<!-- /wp:inner -->\n\nExample.\n\n<!-- wp:void /--><!-- /wp:outer -->"; 65 66 $blocks = parse_blocks( $markup ); 66 67 67 $actual = serialize_blocks( $blocks, array( __CLASS__, 'add_attribute_to_inner_block' ) );68 $actual = traverse_and_serialize_blocks( $blocks, array( __CLASS__, 'add_attribute_to_inner_block' ) ); 68 69 69 70 $this->assertSame( … … 79 80 return $block; 80 81 } 82 83 /** 84 * @ticket 59327 85 * 86 * @covers ::traverse_and_serialize_blocks 87 * 88 * @dataProvider data_serialize_identity_from_parsed 89 * 90 * @param string $original Original block markup. 91 */ 92 public function test_traverse_and_serialize_identity_from_parsed( $original ) { 93 $blocks = parse_blocks( $original ); 94 95 $actual = traverse_and_serialize_blocks( 96 $blocks, 97 function ( $block ) { 98 return $block; 99 } 100 ); 101 102 $this->assertSame( $original, $actual ); 103 } 81 104 }
Note: See TracChangeset
for help on using the changeset viewer.