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
dev
tests
integration
testsuite
Magento
Catalog
_files
product_attribute_with_invalid_apply_to.php
Go to the documentation of this file.
1
<?php
8
$installer
=
\Magento\TestFramework\Helper\Bootstrap::getObjectManager
()->create(
9
\
Magento
\Catalog\Setup\CategorySetup::class
10
);
11
13
$attribute
=
\Magento\TestFramework\Helper\Bootstrap::getObjectManager
()->create(
14
\
Magento
\Catalog\Model\
ResourceModel
\Eav\Attribute::class
15
);
16
$attribute
->setData(
17
[
18
'attribute_code'
=>
'attribute_with_invalid_applyto'
,
19
'entity_type_id'
=>
$installer
->getEntityTypeId(
'catalog_product'
),
20
'apply_to'
=>
'invalid-type'
,
21
]
22
);
23
$attribute
->save();
24
25
/* Assign attribute to attribute set */
26
$installer
->addAttributeToGroup(
'catalog_product'
,
'Default'
,
'General'
,
$attribute
->getId());
27
29
$eavConfig
=
\Magento\TestFramework\Helper\Bootstrap::getObjectManager
()->get(\
Magento
\Eav\Model\Config::class);
30
$eavConfig
->clear();
Magento\Catalog\Model\ResourceModel\Product
Definition:
CollectionTest.php:6
$attribute
$attribute
Definition:
product_attribute_with_invalid_apply_to.php:13
Magento
$eavConfig
$eavConfig
Definition:
product_attribute_with_invalid_apply_to.php:29
Magento\TestFramework\Helper\Bootstrap\getObjectManager
static getObjectManager()
Definition:
Bootstrap.php:125
$installer
$installer
Definition:
product_attribute_with_invalid_apply_to.php:8