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
integration
testsuite
Magento
PageCache
Model
System
Config
Backend
TtlTest.php
Go to the documentation of this file.
1
<?php
6
namespace
Magento\PageCache\Model\System\Config\Backend
;
7
8
class
TtlTest
extends
\PHPUnit\Framework\TestCase
9
{
13
protected
$_model
;
14
18
protected
$_config
;
19
20
protected
function
setUp
()
21
{
22
$this->_config =
\Magento\TestFramework\Helper\Bootstrap::getObjectManager
()
23
->create(\
Magento
\Framework\
App
\
Config
\ScopeConfigInterface::class);
24
$this->_model =
\Magento\TestFramework\Helper\Bootstrap::getObjectManager
()
25
->create(\
Magento
\PageCache\Model\System\
Config
\Backend\Ttl::class);
26
}
27
34
public
function
testBeforeSave
(
$value
,
$path
)
35
{
36
$this->
_prepareData
(
$value
,
$path
);
37
}
38
39
public
function
beforeSaveDataProvider
()
40
{
41
return
[
42
[125,
'ttl_1'
],
43
[0,
'ttl_2'
],
44
];
45
}
46
53
public
function
testBeforeSaveWithException
(
$value
,
$path
)
54
{
55
$this->expectException(\
Magento
\Framework\Exception\LocalizedException::class);
56
$this->
_prepareData
(
$value
,
$path
);
57
}
58
59
public
function
beforeSaveDataProviderWithException
()
60
{
61
return
[
62
[
''
,
'ttl_3'
],
63
[
'sdfg'
,
'ttl_4'
]
64
];
65
}
66
71
protected
function
_prepareData
(
$value
,
$path
)
72
{
73
$this->_model->setValue(
$value
);
74
$this->_model->setPath(
$path
);
75
$this->_model->setField(
$path
);
76
$this->_model->save();
77
}
78
}
Magento\Framework\App
Magento\PageCache\Model\System\Config\Backend\TtlTest\beforeSaveDataProviderWithException
beforeSaveDataProviderWithException()
Definition:
TtlTest.php:59
Magento\PageCache\Model\System\Config\Backend\TtlTest\$_model
$_model
Definition:
TtlTest.php:13
Magento\PageCache\Model\System\Config\Backend\TtlTest\testBeforeSaveWithException
testBeforeSaveWithException($value, $path)
Definition:
TtlTest.php:53
Magento\PageCache\Model\System\Config\Backend
Definition:
TtlTest.php:6
Magento\PageCache\Model\System\Config\Backend\TtlTest\setUp
setUp()
Definition:
TtlTest.php:20
$value
$value
Definition:
gender.phtml:16
Magento\PageCache\Model\System\Config\Backend\TtlTest\testBeforeSave
testBeforeSave($value, $path)
Definition:
TtlTest.php:34
Magento\PageCache\Model\Config
Definition:
Config.php:21
Magento\PageCache\Model\System\Config\Backend\TtlTest
Definition:
TtlTest.php:8
Magento
Magento\PageCache\Model\System\Config\Backend\TtlTest\_prepareData
_prepareData($value, $path)
Definition:
TtlTest.php:71
Magento\PageCache\Model\System\Config\Backend\TtlTest\beforeSaveDataProvider
beforeSaveDataProvider()
Definition:
TtlTest.php:39
Magento\PageCache\Model\System\Config\Backend\TtlTest\$_config
$_config
Definition:
TtlTest.php:18
$path
$path
Definition:
import_with_filesystem_images.php:14
Magento\TestFramework\Helper\Bootstrap\getObjectManager
static getObjectManager()
Definition:
Bootstrap.php:125