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
category_with_two_stores.php
Go to the documentation of this file.
1
<?php
6
use
Magento\TestFramework\Helper\Bootstrap
;
7
9
$category
=
\Magento\TestFramework\Helper\Bootstrap::getObjectManager
()->create(\
Magento
\Catalog\Model\Category::class);
10
$category
->isObjectNew(
true
);
11
$category
->setId(
12
555
13
)->setCreatedAt(
14
'2017-05-5 09:50:07'
15
)->setName(
16
'category-admin'
17
)->setParentId(
18
2
19
)->setPath(
20
'1/2/555'
21
)->setLevel(
22
2
23
)->setAvailableSortBy(
24
[
'position'
,
'name'
]
25
)->setDefaultSortBy(
26
'name'
27
)->setIsActive(
28
true
29
)->setPosition(
30
1
31
)->setUrlKey(
32
'category-admin'
33
)->save();
34
36
$store
= Bootstrap::getObjectManager()->create(\
Magento
\Store\Model\Store::class);
37
38
$category
->setStoreId(
$store
->load(
'default'
)->getId())
39
->setName(
'category-defaultstore'
)
40
->setUrlKey(
'category-defaultstore'
)
41
->save();
42
43
$category
->setStoreId(
$store
->load(
'fixturestore'
)->getId())
44
->setName(
'category-fixturestore'
)
45
->setUrlKey(
'category-fixturestore'
)
46
->save();
Magento\TestFramework\Helper\Bootstrap
Definition:
Bootstrap.php:12
$store
$store
Definition:
category_with_two_stores.php:36
$category
$category
Definition:
category_with_two_stores.php:9
Magento
Magento\TestFramework\Helper\Bootstrap\getObjectManager
static getObjectManager()
Definition:
Bootstrap.php:125