private function testCreateFromXml(): void
{ $entities = CustomEntityXmlSchema::
createFromXmlFile(__DIR__ . '/_fixtures/custom-entity-test/Resources/entities.xml'
);
$expected =
new CustomEntityXmlSchema( __DIR__ . '/_fixtures/custom-entity-test/Resources',
new Entities([ new Entity([ 'name' => 'custom_entity_blog',
'fields' =>
[ new IntField(['name' => 'position', 'storeApiAware' => true
]),
new FloatField(['name' => 'rating', 'storeApiAware' => true
]),
new StringField(['name' => 'title', 'storeApiAware' => true, 'required' => true, 'translatable' => true
]),
new TextField(['name' => 'content', 'storeApiAware' => true, 'allowHtml' => true, 'translatable' => true
]),
new BoolField(['name' => 'display', 'storeApiAware' => true, 'translatable' => true
]),
new JsonField(['name' => 'payload', 'storeApiAware' => false
]),
new EmailField(['name' => 'email', 'storeApiAware' => false
]),
new PriceField(['name' => 'price', 'storeApiAware' => false
]),
new DateField(['name' => 'my_date', 'storeApiAware' => false
]),
new ManyToManyField(['name' => 'products', 'storeApiAware' => true, 'reference' => 'product', 'inherited' => false
]),
new ManyToOneField(['name' => 'top_seller_restrict', 'storeApiAware' => true, 'reference' => 'product', 'required' => false, 'inherited' => false, 'onDelete' => 'restrict'
]),
new ManyToOneField(['name' => 'top_seller_cascade', 'storeApiAware' => true, 'reference' => 'product', 'required' => true, 'inherited' => false, 'onDelete' => 'cascade'
]),
new ManyToOneField(['name' => 'top_seller_set_null', 'storeApiAware' => true, 'reference' => 'product', 'inherited' => false, 'onDelete' => 'set-null'
]),