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-base
setup
src
Magento
Setup
Test
Unit
Fixtures
AttributeSet
PatternTest.php
Go to the documentation of this file.
1
<?php
7
namespace
Magento\Setup\Test\Unit\Fixtures\AttributeSet
;
8
12
class
PatternTest
extends
\PHPUnit\Framework\TestCase
13
{
14
public
function
testGenerateAttributeSet
()
15
{
16
$attributeSets = [
17
'name'
=>
'attribute set name'
,
18
'attributes'
=> [
19
'attribute'
=> [
20
[
21
'is_required'
=> 1,
22
'is_visible_on_front'
=> 1,
23
'is_visible_in_advanced_search'
=> 0,
24
'is_filterable'
=> 0,
25
'is_filterable_in_search'
=> 0,
26
'attribute_code'
=>
'attribute_1'
,
27
'is_searchable'
=> 0,
28
'frontend_label'
=>
'Attribute 1'
,
29
'frontend_input'
=>
'select'
,
30
'backend_type'
=> 1,
31
'default_option'
=>
'option 1'
,
32
'options'
=> [
33
'option'
=> [
34
[
35
'label'
=>
'option 1'
,
36
'value'
=>
'option_1'
37
],
38
[
39
'label'
=>
'option 2'
,
40
'value'
=>
'option_2'
41
]
42
]
43
]
44
]
45
]
46
]
47
];
48
$pattern
= new \Magento\Setup\Fixtures\AttributeSet\Pattern();
49
$this->assertEquals(
50
$attributeSets,
51
$pattern
->generateAttributeSet(
52
'attribute set name'
,
53
1,
54
2,
55
function
(
$index
,
$attributeData
) {
56
$attributeData
[
'backend_type'
] =
$index
;
57
return
$attributeData
;
58
}
59
)
60
);
61
}
62
}
$pattern
$pattern
Definition:
website.php:22
Magento\Setup\Test\Unit\Fixtures\AttributeSet\PatternTest\testGenerateAttributeSet
testGenerateAttributeSet()
Definition:
PatternTest.php:14
Magento\Setup\Test\Unit\Fixtures\AttributeSet\PatternTest
Definition:
PatternTest.php:12
Magento\Setup\Test\Unit\Fixtures\AttributeSet
Definition:
AttributeSetFixtureTest.php:7
function
else function()
Definition:
serializer.phtml:42
$index
$index
Definition:
list.phtml:44
$attributeData
$attributeData
Definition:
attribute_set_with_image_attribute.php:28