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
magento2-functional-testing-framework
dev
tests
unit
Util
OperationDefinitionBuilder.php
Go to the documentation of this file.
1
<?php
6
namespace
tests\unit\Util
;
7
8
use
Magento\FunctionalTestingFramework\DataGenerator\Objects\OperationDefinitionObject
;
9
10
class
OperationDefinitionBuilder
11
{
17
private
$name;
18
24
private
$operation;
25
31
private
$type;
32
38
private
$metadata = [];
39
44
private
$removeBackend;
45
51
public
function
build
()
52
{
53
return
new
OperationDefinitionObject
(
54
$this->
name
,
55
$this->operation,
56
$this->type,
57
null
,
58
null
,
59
null
,
60
null
,
61
null
,
62
$this->metadata,
63
null
,
64
false
65
);
66
}
67
74
public
function
withName
($name)
75
{
76
$this->
name
= $name;
77
return
$this;
78
}
79
86
public
function
withOperation
($operation)
87
{
88
$this->operation = $operation;
89
return
$this;
90
}
91
98
public
function
withType
($type)
99
{
100
$this->type = $type;
101
return
$this;
102
}
103
110
public
function
withMetadata
($metadata)
111
{
112
$primitives = [];
113
foreach
($metadata as $fieldName =>
$value
) {
114
// type check here TODO
115
if
(is_string(
$value
)) {
116
$primitives[$fieldName] =
$value
;
117
}
else
{
118
$this->metadata[] =
$value
;
119
}
120
}
121
122
$this->metadata = array_merge(
123
$this->metadata,
124
OperationElementBuilder::buildOperationElementFields
($primitives)
125
);
126
return
$this;
127
}
128
}
tests\unit\Util
Definition:
ActionGroupObjectBuilder.php:7
tests\unit\Util\OperationElementBuilder\buildOperationElementFields
static buildOperationElementFields($fields)
Definition:
OperationElementBuilder.php:182
tests\unit\Util\OperationDefinitionBuilder\withName
withName($name)
Definition:
OperationDefinitionBuilder.php:74
tests\unit\Util\OperationDefinitionBuilder\withType
withType($type)
Definition:
OperationDefinitionBuilder.php:98
tests\unit\Util\OperationDefinitionBuilder
Definition:
OperationDefinitionBuilder.php:10
name
Magento\FunctionalTestingFramework\DataGenerator\Objects\OperationDefinitionObject
Definition:
OperationDefinitionObject.php:12
tests\unit\Util\OperationDefinitionBuilder\build
build()
Definition:
OperationDefinitionBuilder.php:51
tests\unit\Util\OperationDefinitionBuilder\withMetadata
withMetadata($metadata)
Definition:
OperationDefinitionBuilder.php:110
$value
$value
Definition:
gender.phtml:16
tests\unit\Util\OperationDefinitionBuilder\withOperation
withOperation($operation)
Definition:
OperationDefinitionBuilder.php:86