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)
Main Page
Related Pages
+
Namespaces
Namespace List
+
Namespace Members
+
All
$
_
c
d
e
f
g
h
i
m
p
r
s
t
u
+
Functions
_
c
d
e
f
g
h
i
m
p
r
s
t
u
Variables
+
Data Structures
Data Structures
Data Structure Index
Class Hierarchy
+
Data Fields
+
All
$
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
+
Functions
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
+
Variables
$
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
+
Files
File List
+
Globals
+
All
$
(
_
a
b
c
d
e
f
g
h
i
j
m
n
o
p
q
r
s
t
u
v
w
+
Functions
_
c
d
e
f
g
m
o
r
s
t
v
+
Variables
$
(
_
a
b
c
d
e
f
g
h
i
j
m
n
o
p
q
r
s
t
u
v
w
Examples
•
All
Data Structures
Namespaces
Files
Functions
Variables
Pages
vendor
magento
module-cms
Test
Unit
Model
Page
Source
PageLayoutTest.php
Go to the documentation of this file.
1
<?php
6
namespace
Magento\Cms\Test\Unit\Model\Page\Source
;
7
8
use
Magento\Cms\Model\Page\Source\PageLayout
;
9
use
Magento\Framework\TestFramework\Unit\Helper\ObjectManager
;
10
use
Magento\Framework\View\Model\PageLayout\Config\BuilderInterface
;
11
use
Magento\Framework\View\PageLayout\Config
;
12
13
class
PageLayoutTest
extends
\PHPUnit\Framework\TestCase
14
{
18
protected
$builderMock
;
19
23
protected
$pageLayoutConfigMock
;
24
28
protected
$objectManagerHelper
;
29
33
protected
$object
;
34
38
protected
function
setUp
()
39
{
40
$this->objectManagerHelper =
new
ObjectManager
($this);
41
$this->builderMock = $this->getMockBuilder(
42
\
Magento
\Framework\View\Model\
PageLayout
\
Config
\BuilderInterface::class
43
)->disableOriginalConstructor()
44
->setMethods([
'getPageLayoutsConfig'
])
45
->getMock();
46
$this->pageLayoutConfigMock = $this->getMockBuilder(\
Magento
\Framework\View\
PageLayout
\Config::class)
47
->disableOriginalConstructor()
48
->setMethods([
'getOptions'
])
49
->getMock();
50
51
$this->builderMock->expects($this->any())
52
->method(
'getPageLayoutsConfig'
)
53
->willReturn($this->pageLayoutConfigMock);
54
55
$this->
object
= $this->objectManagerHelper->getObject($this->
getSourceClassName
(), [
56
'pageLayoutBuilder'
=> $this->builderMock,
57
]);
58
}
59
63
protected
function
getSourceClassName
()
64
{
65
return \Magento\Cms\Model\Page\Source\PageLayout::class;
66
}
67
74
public
function
testToOptionArray
(array
$options
, array $expected)
75
{
76
$this->pageLayoutConfigMock->expects($this->once())
77
->method(
'getOptions'
)
78
->willReturn(
$options
);
79
80
$this->assertSame($expected, $this->object->toOptionArray());
81
}
82
86
public
function
getOptionsDataProvider
()
87
{
88
return
[
89
[
90
[],
91
[],
92
],
93
[
94
[
'testStatus'
=>
'testValue'
],
95
[[
'label'
=>
'testValue'
,
'value'
=>
'testStatus'
]],
96
],
97
98
];
99
}
100
}
Magento\Cms\Test\Unit\Model\Page\Source\PageLayoutTest\testToOptionArray
testToOptionArray(array $options, array $expected)
Definition:
PageLayoutTest.php:74
Magento\Cms\Test\Unit\Model\Page\Source\PageLayoutTest\getSourceClassName
getSourceClassName()
Definition:
PageLayoutTest.php:63
Magento\Cms\Test\Unit\Model\Page\Source\PageLayoutTest\$objectManagerHelper
$objectManagerHelper
Definition:
PageLayoutTest.php:28
Magento\Framework\View\Model\PageLayout\Config\BuilderInterface
Definition:
BuilderInterface.php:11
Magento\Cms\Test\Unit\Model\Page\Source\PageLayoutTest\$pageLayoutConfigMock
$pageLayoutConfigMock
Definition:
PageLayoutTest.php:23
Magento\Cms\Test\Unit\Model\Page\Source\PageLayoutTest
Definition:
PageLayoutTest.php:13
Magento\Framework\View\PageLayout\Config
Definition:
Config.php:12
Magento\Cms\Test\Unit\Model\Page\Source\PageLayoutTest\$builderMock
$builderMock
Definition:
PageLayoutTest.php:18
Magento\Cms\Test\Unit\Model\Page\Source\PageLayoutTest\setUp
setUp()
Definition:
PageLayoutTest.php:38
Magento\Cms\Test\Unit\Model\Page\Source\PageLayoutTest\$object
$object
Definition:
PageLayoutTest.php:33
Magento
Magento\Framework\TestFramework\Unit\Helper\ObjectManager
Definition:
ObjectManager.php:13
Magento\Cms\Model\Page\Source\PageLayout
Definition:
PageLayout.php:14
Magento\Cms\Test\Unit\Model\Page\Source\PageLayoutTest\getOptionsDataProvider
getOptionsDataProvider()
Definition:
PageLayoutTest.php:86
Magento\Cms\Test\Unit\Model\Page\Source
Definition:
CustomLayoutTest.php:6
$options
$options
Definition:
multiple_mixed_products.php:29