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
Config
Source
ListSortTest.php
Go to the documentation of this file.
1
<?php
6
namespace
Magento\Catalog\Test\Unit\Model\Config\Source
;
7
8
use
Magento\Framework\TestFramework\Unit\Helper\ObjectManager
;
9
10
class
ListSortTest
extends
\PHPUnit\Framework\TestCase
11
{
15
private
$model;
16
20
private
$catalogConfig;
21
22
protected
function
setUp
()
23
{
24
$this->catalogConfig = $this->getMockBuilder(\
Magento
\Catalog\Model\Config::class)
25
->disableOriginalConstructor()->getMock();
26
27
$helper
=
new
ObjectManager
($this);
28
$this->model =
$helper
->getObject(
29
\
Magento
\Catalog\Model\
Config
\Source\ListSort::class,
30
[
'catalogConfig'
=> $this->catalogConfig]
31
);
32
}
33
34
public
function
testToOptionalArray
()
35
{
36
$except = [
37
[
'label'
=>
__
(
'Position'
),
'value'
=>
'position'
],
38
[
'label'
=>
'testLabel'
,
'value'
=>
'testAttributeCode'
],
39
];
40
$this->catalogConfig->expects($this->any())->method(
'getAttributesUsedForSortBy'
)
41
->will($this->returnValue([[
'frontend_label'
=>
'testLabel'
,
'attribute_code'
=>
'testAttributeCode'
]]));
42
43
$this->assertEquals($except, $this->model->toOptionArray());
44
}
45
}
Magento\Catalog\Test\Unit\Model\Config\Source\ListSortTest\testToOptionalArray
testToOptionalArray()
Definition:
ListSortTest.php:34
$helper
$helper
Definition:
iframe.phtml:13
Magento\Catalog\Test\Unit\Model\Config\Source\ListSortTest
Definition:
ListSortTest.php:10
Magento\Catalog\Test\Unit\Model\Config\Source
Definition:
CategoryTest.php:6
__
__()
Definition:
__.php:13
Magento\Catalog\Test\Unit\Model\Config\Source\ListSortTest\setUp
setUp()
Definition:
ListSortTest.php:22
Magento
Magento\Framework\TestFramework\Unit\Helper\ObjectManager
Definition:
ObjectManager.php:13
Magento\Framework\App\ResourceConnection\Config
Definition:
Config.php:14