I'm trying to make use of a virtual type. I'm following the docs on this and everything should be pretty straight forward yet I'm kinda stuck.
This is what I have.
The class.
namespace Company\Extension\Model\Product\Attribute\Source;
class Test
{
protected $string;
public function __construct(String $test)
{
$this->string = $test;
}
public function test()
{
return $this->string;
}
}
The di.xml
<config>
<virtualType name="TestVirtualType" type="Company\Extension\Model\Product\Attribute\Source\Test">
<arguments>
<argument name="value" xsi:type="string">foo</argument>
</arguments>
</virtualType>
</config>
Now when running a simple php/bin magento
[Magento\Framework\Exception\LocalizedException]
Invalid Document
Element 'argument': The type definition is abstract.
Line: 13
Internal error: xmlSchemaXPathProcessHistory, The state object to be removed is not the first in the list.
Line: 12
Internal error: xmlSchemaValidateChildElem, calling xmlRegExecPushString2().
Line: 3
Internal error: xmlSchemaValidateElem, calling xmlSchemaStreamValidateChildElement().
Line: 3
Internal error: xmlSchemaDocWalk, calling xmlSchemaValidateElem().
Line: 3
I'm following the docs on this as well as many provided examples. I'm not really sure what I'm doing wrong. Any help or pointers in the right direction are highly appreciated