Skip to content

Commit 50c9d8d

Browse files
committed
Add test for something that exists
1 parent 3b8fdc6 commit 50c9d8d

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

tests/Testing/BlockFactoryTest.php

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff 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
}

0 commit comments

Comments
 (0)