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-catalog
Test
Unit
Model
Layer
Filter
Item
DataBuilderTest.php
Go to the documentation of this file.
1
<?php
7
namespace
Magento\Catalog\Test\Unit\Model\Layer\Filter\Item
;
8
9
use
Magento\Framework\TestFramework\Unit\Helper\ObjectManager
as ObjectManagerHelper;
10
11
class
DataBuilderTest
extends
\PHPUnit\Framework\TestCase
12
{
16
protected
$dataBuilder
;
17
18
protected
function
setUp
()
19
{
20
$objectManagerHelper =
new
ObjectManagerHelper($this);
21
$this->dataBuilder = $objectManagerHelper->getObject(
22
\
Magento
\Catalog\Model\Layer\Filter\Item\DataBuilder::class,
23
[]
24
);
25
}
26
27
public
function
testBuild
()
28
{
29
$data
= [
30
[
31
'label'
=>
'Test label'
,
32
'value'
=> 34,
33
'count'
=> 21235,
34
],
35
[
36
'label'
=>
'New label for test'
,
37
'value'
=> 2344,
38
'count'
=> 122,
39
],
40
];
41
42
foreach
(
$data
as
$item
) {
43
$this->dataBuilder->addItemData(
$item
[
'label'
],
$item
[
'value'
],
$item
[
'count'
]);
44
}
45
46
$actualData = $this->dataBuilder->build();
47
$this->assertEquals(
$data
, $actualData);
48
}
49
}
Magento\Catalog\Test\Unit\Model\Layer\Filter\Item\DataBuilderTest\setUp
setUp()
Definition:
DataBuilderTest.php:18
$item
$item
Definition:
partial_invoice.php:27
Magento\Catalog\Test\Unit\Model\Layer\Filter\Item\DataBuilderTest
Definition:
DataBuilderTest.php:11
Magento\Catalog\Test\Unit\Model\Layer\Filter\Item\DataBuilderTest\testBuild
testBuild()
Definition:
DataBuilderTest.php:27
$data
$data
Definition:
attribute_set_with_image_attribute.php:16
Magento\Catalog\Test\Unit\Model\Layer\Filter\Item
Definition:
DataBuilderTest.php:7
Magento
Magento\Framework\TestFramework\Unit\Helper\ObjectManager
Definition:
ObjectManager.php:13
Magento\Catalog\Test\Unit\Model\Layer\Filter\Item\DataBuilderTest\$dataBuilder
$dataBuilder
Definition:
DataBuilderTest.php:16