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
module-configurable-product
Test
Unit
Model
Product
Type
VariationMatrixTest.php
Go to the documentation of this file.
1
<?php
7
namespace
Magento\ConfigurableProduct\Test\Unit\Model\Product\Type
;
8
9
use
Magento\Framework\TestFramework\Unit\Helper\ObjectManager
as ObjectManagerHelper;
10
11
class
VariationMatrixTest
extends
\PHPUnit\Framework\TestCase
12
{
14
protected
$model
;
15
17
protected
$objectManagerHelper
;
18
19
protected
function
setUp
()
20
{
21
$this->objectManagerHelper =
new
ObjectManagerHelper($this);
22
23
$this->model = $this->objectManagerHelper->getObject(
24
\
Magento
\
ConfigurableProduct
\Model\
Product
\
Type
\VariationMatrix::class
25
);
26
}
27
28
public
function
testGetVariations
()
29
{
30
$result
= [
31
[
32
130 => [
33
'value'
=>
'3'
,
34
'label'
=>
'red'
,
35
'price'
=> [
'value_index'
=>
'3'
,
'pricing_value'
=>
''
,
'is_percent'
=>
'0'
,
'include'
=>
'1'
,],
36
],
37
],
38
[
39
130 => [
40
'value'
=>
'4'
,
41
'label'
=>
'blue'
,
42
'price'
=> [
'value_index'
=>
'4'
,
'pricing_value'
=>
''
,
'is_percent'
=>
'0'
,
'include'
=>
'1'
,],
43
],
44
],
45
];
46
47
$input = [
48
130 => [
49
'values'
=> [
50
[
51
'value_index'
=>
'3'
,
52
'pricing_value'
=>
''
,
53
'is_percent'
=>
'0'
,
54
'include'
=>
'1'
55
],
56
[
57
'value_index'
=>
'4'
,
58
'pricing_value'
=>
''
,
59
'is_percent'
=>
'0'
,
60
'include'
=>
'1'
61
],
62
],
63
'attribute_id'
=>
'130'
,
64
'options'
=> [[
'value'
=>
'3'
,
'label'
=>
'red'
,], [
'value'
=>
'4'
,
'label'
=>
'blue'
,],],
65
],
66
];
67
68
$this->assertEquals(
$result
, $this->model->getVariations($input));
69
}
70
}
$result
$result
Definition:
product_configurable_not_available_rollback.php:26
Magento\Catalog\Model\Product\Type
Definition:
Type.php:17
Magento\ConfigurableProduct\Test\Unit\Model\Product\Type\VariationMatrixTest\$objectManagerHelper
$objectManagerHelper
Definition:
VariationMatrixTest.php:17
Magento\ConfigurableProduct\Test\Unit\Model\Product\Type\VariationMatrixTest\setUp
setUp()
Definition:
VariationMatrixTest.php:19
Magento\ConfigurableProduct\Model\Product\Type\Configurable
Definition:
AttributeTest.php:6
Magento\Catalog\Model\Product
Definition:
Product.php:42
Magento\ConfigurableProduct\Test\Unit\Model\Product\Type
Magento
Magento\Framework\TestFramework\Unit\Helper\ObjectManager
Definition:
ObjectManager.php:13
Magento\ConfigurableProduct\Test\Unit\Model\Product\Type\VariationMatrixTest
Definition:
VariationMatrixTest.php:11
Magento\ConfigurableProduct\Test\Unit\Model\Product\Type\VariationMatrixTest\testGetVariations
testGetVariations()
Definition:
VariationMatrixTest.php:28
Magento\ConfigurableProduct\Test\Unit\Model\Product\Type\VariationMatrixTest\$model
$model
Definition:
VariationMatrixTest.php:14