18 $this->markTestSkipped(
'Skipped on HHVM. Will be fixed in MAGETWO-45033');
20 $urnResolver = new \Magento\Framework\Config\Dom\UrnResolver();
21 $this->schemaFile = $urnResolver->getRealPath(
'urn:magento:framework-message-queue:etc/topology_merged.xsd');
31 $validationState = $this->createMock(\
Magento\Framework\
Config\ValidationStateInterface::class);
32 $validationState->expects($this->any())
33 ->method(
'isValidationRequired')
35 $messageFormat =
'%message%';
36 $dom = new \Magento\Framework\Config\Dom($fixtureXml, $validationState, [],
null,
null, $messageFormat);
38 $actualResult = $dom->validate($this->schemaFile, $actualErrors);
39 $this->assertEquals(empty($expectedErrors), $actualResult,
"Validation result is invalid.");
40 $this->assertEquals($expectedErrors, $actualErrors,
"Validation errors does not match.");
53 '<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework-message-queue:etc/topology.xsd"> 54 <exchange name="ex01" type="topic" connection="amqp" /> 55 <exchange name="ex02" type="topic" connection="amqp" /> 56 <exchange name="ex03" autoDelete="true" durable="false" internal="true" type="topic" connection="db"> 58 <argument name="arg1" xsi:type="string">10</argument> 61 <exchange name="ex04" type="topic" connection="amqp"> 62 <binding id="bind01" destinationType="queue" destination="queue01" topic="top01" disabled="true" /> 63 <binding id="bind02" destinationType="queue" destination="queue01" topic="top01"> 65 <argument name="arg01" xsi:type="string">10</argument> 72 'non-unique-exchange' => [
73 '<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework-message-queue:etc/topology.xsd"> 74 <exchange name="ex01" type="topic" connection="amqp"/> 75 <exchange name="ex01" type="topic" connection="amqp" /> 78 "Element 'exchange': Duplicate key-sequence ['ex01', 'amqp'] in unique identity-constraint 'unique-exchange-name-connection'." 81 'non-unique-exchange-binding' => [
82 '<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework-message-queue:etc/topology.xsd"> 83 <exchange name="ex01" connection="amqp" type="topic"> 84 <binding id="bind01" destinationType="queue" destination="queue01" topic="top01" disabled="true" /> 85 <binding id="bind01" destinationType="queue" destination="queue01" topic="top01" /> 89 "Element 'binding': Duplicate key-sequence ['bind01'] in unique identity-constraint 'unique-binding-id'." 92 'invalid-destination-type-binding' => [
93 '<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework-message-queue:etc/topology.xsd"> 94 <exchange name="ex01" type="topic" connection="amqp"> 95 <binding id="bind01" destinationType="topic" destination="queue01" topic="top01" /> 99 "Element 'binding', attribute 'destinationType': [facet 'enumeration'] The value 'topic' is not an element of the set {'queue'}.",
100 "Element 'binding', attribute 'destinationType': 'topic' is not a valid value of the atomic type 'destinationType'." 103 'invalid-exchange-type-binding' => [
104 '<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework-message-queue:etc/topology.xsd"> 105 <exchange name="ex01" type="exchange" connection="db"> 106 <binding id="bind01" destinationType="queue" destination="queue01" topic="top01" /> 110 "Element 'exchange', attribute 'type': [facet 'enumeration'] The value 'exchange' is not an element of the set {'topic'}.",
111 "Element 'exchange', attribute 'type': 'exchange' is not a valid value of the atomic type 'exchangeType'." 114 'missed-required-attributes' => [
115 '<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework-message-queue:etc/topology.xsd"> 116 <exchange name="ex01" type="topic" /> 117 <exchange name="ex02" connection="amqp" /> 120 "Element 'exchange': The attribute 'connection' is required but missing.",
121 "Element 'exchange': The attribute 'type' is required but missing."
exemplarXmlDataProvider()
testExemplarXml($fixtureXml, array $expectedErrors)