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
functional
tests
app
Magento
Catalog
Test
TestStep
CreateProductStep.php
Go to the documentation of this file.
1
<?php
7
namespace
Magento\Catalog\Test\TestStep
;
8
9
use Magento\Mtf\Fixture\FixtureFactory;
10
use Magento\Mtf\Fixture\FixtureInterface;
11
use Magento\Mtf\TestStep\TestStepInterface;
12
16
class
CreateProductStep
implements
TestStepInterface
17
{
23
protected
$product
;
24
30
protected
$fixtureFactory
;
31
39
public
function
__construct
(FixtureFactory
$fixtureFactory
,
$product
)
40
{
41
$this->product =
$product
;
42
$this->fixtureFactory =
$fixtureFactory
;
43
}
44
50
public
function
run()
51
{
52
list($fixtureClass, $dataset) = explode(
'::'
, $this->product);
54
$product
= $this->fixtureFactory->createByCode(trim($fixtureClass), [
'dataset'
=> trim($dataset)]);
55
if
(
$product
->hasData(
'id'
) ===
false
) {
56
$product
->persist();
57
}
58
return
[
'product'
=>
$product
];
59
}
60
}
Magento\Catalog\Test\TestStep\CreateProductStep
Definition:
CreateProductStep.php:16
Magento\Catalog\Test\TestStep\CreateProductStep\$product
$product
Definition:
CreateProductStep.php:23
Magento\Catalog\Test\TestStep
Definition:
AddAttributeToAttributeSetStep.php:7
Magento\Catalog\Test\TestStep\CreateProductStep\__construct
__construct(FixtureFactory $fixtureFactory, $product)
Definition:
CreateProductStep.php:39
Magento\Catalog\Test\TestStep\CreateProductStep\$fixtureFactory
$fixtureFactory
Definition:
CreateProductStep.php:30