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-backend
Test
Unit
Model
Config
SessionLifetime
BackendModelTest.php
Go to the documentation of this file.
1
<?php
7
namespace
Magento\Backend\Test\Unit\Model\Config\SessionLifetime
;
8
9
use
Magento\Backend\Model\Config\SessionLifetime\BackendModel
;
10
use
Magento\Framework\TestFramework\Unit\Helper\ObjectManager
;
11
12
class
BackendModelTest
extends
\PHPUnit\Framework\TestCase
13
{
17
public
function
testBeforeSave(
$value
, $errorMessage =
null
)
18
{
20
$model
= (
new
ObjectManager
($this))->getObject(
21
\
Magento
\Backend\Model\Config\SessionLifetime\BackendModel::class
22
);
23
if
($errorMessage !==
null
) {
24
$this->expectException(\
Magento
\Framework\Exception\LocalizedException::class);
25
$this->expectExceptionMessage($errorMessage);
26
}
27
$model
->setValue(
$value
);
28
$object =
$model
->beforeSave();
29
$this->assertEquals(
$model
, $object);
30
}
31
35
public
function
adminSessionLifetimeDataProvider
()
36
{
37
return
[
38
[
39
BackendModel::MIN_LIFETIME
- 1,
40
'The Admin session lifetime is invalid. Set the lifetime to 60 seconds or longer and try again.'
41
],
42
[
43
BackendModel::MAX_LIFETIME
+ 1,
44
'The Admin session lifetime is invalid. '
45
.
'Set the lifetime to 31536000 seconds (one year) or shorter and try again.'
46
],
47
[
48
900
49
]
50
];
51
}
52
}
$model
$model
Definition:
enable_catalog_product_reindex_schedule.php:9
Magento\Backend\Model\Config\SessionLifetime\BackendModel
Definition:
BackendModel.php:17
Magento\Backend\Test\Unit\Model\Config\SessionLifetime
Definition:
BackendModelTest.php:7
Magento\Backend\Model\Config\SessionLifetime\BackendModel\MAX_LIFETIME
const MAX_LIFETIME
Definition:
BackendModel.php:20
$value
$value
Definition:
gender.phtml:16
Magento\Backend\Model\Config\SessionLifetime\BackendModel\MIN_LIFETIME
const MIN_LIFETIME
Definition:
BackendModel.php:23
Magento
Magento\Framework\TestFramework\Unit\Helper\ObjectManager
Definition:
ObjectManager.php:13
Magento\Backend\Test\Unit\Model\Config\SessionLifetime\BackendModelTest
Definition:
BackendModelTest.php:12
Magento\Backend\Test\Unit\Model\Config\SessionLifetime\BackendModelTest\adminSessionLifetimeDataProvider
adminSessionLifetimeDataProvider()
Definition:
BackendModelTest.php:35