File tree Expand file tree Collapse file tree 1 file changed +16
-0
lines changed
Expand file tree Collapse file tree 1 file changed +16
-0
lines changed Original file line number Diff line number Diff line change @@ -97,6 +97,17 @@ public function test_it_can_generate_a_preset() {
9797 ),
9898 );
9999
100+ Block_Factory::register_preset (
101+ 'title_with_arguments ' ,
102+ fn ( Block_Factory $ factory , string $ title ) => $ factory ->block (
103+ 'namespace/multititle ' ,
104+ '' ,
105+ [
106+ 'seo ' => $ title ,
107+ ]
108+ ),
109+ );
110+
100111 $ this ->assertStringStartsWith (
101112 '<!-- wp:heading {"level":2} --> ' ,
102113 block_factory ()->test (),
@@ -120,5 +131,10 @@ public function test_it_can_generate_a_preset() {
120131 '<!-- wp:namespace/multititle {"seo":"Attribute on the block"} /--> ' ,
121132 block_factory ()->preset ( 'title_block ' ),
122133 );
134+
135+ $ this ->assertEquals (
136+ '<!-- wp:namespace/multititle {"seo":"Title Here"} /--> ' ,
137+ block_factory ()->title_with_arguments ( 'Title Here ' ),
138+ );
123139 }
124140}
You can’t perform that action at this time.
0 commit comments