Skip to content

Commit 087b922

Browse files
committed
Test custom field rules can be deserialized for publication type schemas
1 parent 68f09c6 commit 087b922

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

packages/framework/tests/Feature/PublicationTypeTest.php

+15
Original file line numberDiff line numberDiff line change
@@ -173,6 +173,21 @@ public function test_get_field_rules()
173173
], $publicationType->getFieldRules()->toArray());
174174
}
175175

176+
public function test_get_field_rules_with_custom_type_rules()
177+
{
178+
$publicationType = new PublicationType(...$this->getTestData(['fields' => [
179+
'title' => [
180+
'name' => 'title',
181+
'type' => 'string',
182+
'rules' => ['required', 'foo'],
183+
],
184+
]]));
185+
186+
$this->assertEquals([
187+
'title' => ['string', 'required', 'foo'],
188+
], $publicationType->getFieldRules()->toArray());
189+
}
190+
176191
protected function getTestData(array $mergeData = []): array
177192
{
178193
return array_merge([

0 commit comments

Comments
 (0)