Magento Extensions Rating 2024
EXTENSIONS BY CATEGORY
B2B (Business-To-Business)
Blog
Customer
ERP (Enterprise Resource Planning)
Mega Menu
One Step Checkout
Order
POS (Point Of Sale)
Search
Shopping Cart
Sitemap
SEO
Social
Stock & Inventory Management
EXTENSIONS BY DEVELOPER
aheadWorks
Amasty
Boost My Shop
BSS Commerce
Magestore
MageWorx
Mirasvit
Templates Master
Wyomind
XTENTO
Magento 2 Documentation
Magento 2 Documentation
2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
vendor
magento
framework-message-queue
Test
Unit
Topology
Config
Validator
DependantFieldsTest.php
Go to the documentation of this file.
1
<?php
6
namespace
Magento\Framework\MessageQueue\Test\Unit\Topology\Config\Validator
;
7
8
use \Magento\Framework\MessageQueue\Topology\Config\Validator\DependentFields;
9
10
class
DependantFieldsTest
extends
\PHPUnit\Framework\TestCase
11
{
15
private
$model;
16
17
protected
function
setUp
()
18
{
19
$this->model =
new
DependentFields
();
20
}
21
22
public
function
testValidateValidConfig
()
23
{
24
$configData
= [
25
'ex01'
=> [
26
'name'
=>
'ex01'
,
27
'type'
=>
'topic'
,
28
'connection'
=>
'amqp'
,
29
'durable'
=>
true
,
30
'internal'
=>
false
,
31
'autoDelete'
=>
false
,
32
'arguments'
=> [
'some'
=>
'argument'
],
33
'bindings'
=> [
34
'bind01'
=> [
35
'id'
=>
'bind01'
,
36
'topic'
=>
'bind01'
,
37
'destinationType'
=>
'queue'
,
38
'destination'
=>
'bind01'
,
39
'disabled'
=>
false
,
40
'arguments'
=> [
'some'
=>
'arguments'
],
41
],
42
],
43
],
44
'ex02'
=> [
45
'name'
=>
'ex01'
,
46
'type'
=>
'headers'
,
47
'connection'
=>
'amqp'
,
48
'durable'
=>
true
,
49
'internal'
=>
false
,
50
'autoDelete'
=>
false
,
51
'arguments'
=> [
'some'
=>
'argument'
],
52
'bindings'
=> [
53
'bind01'
=> [
54
'id'
=>
'bind01'
,
55
'destinationType'
=>
'queue'
,
56
'destination'
=>
'some.queue'
,
57
'disabled'
=>
false
,
58
'arguments'
=> [
'some'
=>
'arguments'
],
59
],
60
],
61
],
62
];
63
$this->model->validate(
$configData
);
64
}
65
66
public
function
testValidateMissingTopicField
()
67
{
68
$expectedMessage =
"Topic name is required for topic based exchange: ex01"
;
69
$this->expectException(
'\LogicException'
);
70
$this->expectExceptionMessage($expectedMessage);
71
$configData
= [
72
'ex01'
=> [
73
'name'
=>
'ex01'
,
74
'type'
=>
'topic'
,
75
'connection'
=>
'amqp'
,
76
'durable'
=>
true
,
77
'internal'
=>
false
,
78
'autoDelete'
=>
false
,
79
'arguments'
=> [
'some'
=>
'argument'
],
80
'bindings'
=> [
81
'bind01'
=> [
82
'id'
=>
'bind01'
,
83
'destinationType'
=>
'queue'
,
84
'destination'
=>
'bind01'
,
85
'disabled'
=>
false
,
86
'arguments'
=> [
'some'
=>
'arguments'
],
87
],
88
],
89
]
90
];
91
$this->model->validate(
$configData
);
92
}
93
}
Magento\Framework\MessageQueue\Test\Unit\Topology\Config\Validator\DependantFieldsTest\setUp
setUp()
Definition:
DependantFieldsTest.php:17
Magento\Framework\MessageQueue\Test\Unit\Topology\Config\Validator\DependantFieldsTest
Definition:
DependantFieldsTest.php:10
$configData
$configData
Definition:
payment_configuration.php:26
Magento\Framework\MessageQueue\Test\Unit\Topology\Config\Validator\DependantFieldsTest\testValidateValidConfig
testValidateValidConfig()
Definition:
DependantFieldsTest.php:22
Magento\Framework\MessageQueue\Test\Unit\Topology\Config\Validator\DependantFieldsTest\testValidateMissingTopicField
testValidateMissingTopicField()
Definition:
DependantFieldsTest.php:66
Magento\Framework\MessageQueue\Test\Unit\Topology\Config\Validator
Definition:
DependantFieldsTest.php:6
Magento\Framework\MessageQueue\Topology\Config\Validator\DependentFields
Definition:
DependentFields.php:13