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
Publisher
Config
Validator
EnabledConnectionTest.php
Go to the documentation of this file.
1
<?php
2
8
namespace
Magento\Framework\MessageQueue\Test\Unit\Publisher\Config\Validator
;
9
10
use \Magento\Framework\MessageQueue\Publisher\Config\Validator\EnabledConnection;
11
12
class
EnabledConnectionTest
extends
\PHPUnit\Framework\TestCase
13
{
17
private
$model;
18
19
protected
function
setUp
()
20
{
21
$this->model =
new
EnabledConnection
();
22
}
23
24
public
function
testValidateValidConfig
()
25
{
26
$configData
= [
27
'pub01'
=> [
28
'topic'
=>
'pub01'
,
29
'disabled'
=>
false
,
30
'connections'
=> [
31
'con01'
=> [
'name'
=>
'con1'
,
'exchange'
=>
'exchange01'
,
'disabled'
=>
true
],
32
'con02'
=> [
'name'
=>
'con1'
,
'exchange'
=>
'exchange01'
,
'disabled'
=>
false
],
33
],
34
],
35
'pub02'
=> [
36
'topic'
=>
'pub02'
,
37
'disabled'
=>
false
,
38
'connections'
=> [
39
'con01'
=> [
'name'
=>
'amqp'
,
'exchange'
=>
'magento'
,
'disabled'
=>
true
],
40
]
41
],
42
'pub03'
=> [
43
'topic'
=>
'pub02'
,
44
'disabled'
=>
false
,
45
]
46
];
47
$this->model->validate(
$configData
);
48
}
49
50
public
function
testValidateMultipleEnabledConnections
()
51
{
52
$this->expectException(
'\LogicException'
);
53
$this->expectExceptionMessage(
54
'More than 1 enabled connections configured for publisher pub01. '
.
55
'More than 1 enabled connections configured for publisher pub02.'
56
);
57
$configData
= [
58
'pub01'
=> [
59
'topic'
=>
'pub01'
,
60
'disabled'
=>
false
,
61
'connections'
=> [
62
'con01'
=> [
'name'
=>
'con1'
,
'exchange'
=>
'exchange01'
,
'disabled'
=>
false
],
63
'con02'
=> [
'name'
=>
'con1'
,
'exchange'
=>
'exchange01'
,
'disabled'
=>
false
],
64
],
65
],
66
'pub02'
=> [
67
'topic'
=>
'pub02'
,
68
'disabled'
=>
false
,
69
'connections'
=> [
70
'con01'
=> [
'name'
=>
'con1'
,
'exchange'
=>
'exchange01'
,
'disabled'
=>
false
],
71
'con02'
=> [
'name'
=>
'con1'
,
'exchange'
=>
'exchange01'
,
'disabled'
=>
false
],
72
],
73
],
74
];
75
$this->model->validate(
$configData
);
76
}
77
}
Magento\Framework\MessageQueue\Test\Unit\Publisher\Config\Validator\EnabledConnectionTest\testValidateValidConfig
testValidateValidConfig()
Definition:
EnabledConnectionTest.php:24
Magento\Framework\MessageQueue\Publisher\Config\Validator\EnabledConnection
Definition:
EnabledConnection.php:13
Magento\Framework\MessageQueue\Test\Unit\Publisher\Config\Validator
Definition:
EnabledConnectionTest.php:8
$configData
$configData
Definition:
payment_configuration.php:26
Magento\Framework\MessageQueue\Test\Unit\Publisher\Config\Validator\EnabledConnectionTest
Definition:
EnabledConnectionTest.php:12
Magento\Framework\MessageQueue\Test\Unit\Publisher\Config\Validator\EnabledConnectionTest\testValidateMultipleEnabledConnections
testValidateMultipleEnabledConnections()
Definition:
EnabledConnectionTest.php:50
Magento\Framework\MessageQueue\Test\Unit\Publisher\Config\Validator\EnabledConnectionTest\setUp
setUp()
Definition:
EnabledConnectionTest.php:19