use Shopware\Core\Framework\App\Manifest\Xml\CustomFieldSet;
use Shopware\Core\Framework\App\Manifest\Xml\CustomFieldTypes\CustomFieldTypeFactory;
/**
* @internal
*/
class CustomFieldTypeFactoryTest extends TestCase
{ public function testCreateFromXmlThrowsExceptionOnInvalidTag(): void
{ self::
expectException(CustomFieldTypeNotFoundException::
class);
CustomFieldTypeFactory::
createFromXml(new \
DOMElement('invalid'
));
} public function testTranslatedForTag(): void
{ $manifest = Manifest::
createFromXmlFile(__DIR__ . '/_fixtures/custom-field-type-factory.xml'
);
static::
assertNotNull($manifest->
getCustomFields());
static::
assertCount(1,
$manifest->
getCustomFields()->
getCustomFieldSets());
/** @var CustomFieldSet $customFieldSet */
$customFieldSet =
$manifest->
getCustomFields()->
getCustomFieldSets()[0
];