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-checkout
Test
Unit
Block
Checkout
TotalsProcessorTest.php
Go to the documentation of this file.
1
<?php
7
namespace
Magento\Checkout\Test\Unit\Block\Checkout
;
8
9
class
TotalsProcessorTest
extends
\PHPUnit\Framework\TestCase
10
{
14
protected
$model
;
15
19
protected
$scopeConfigMock
;
20
21
protected
function
setUp
()
22
{
23
$this->scopeConfigMock = $this->createMock(\
Magento
\Framework\
App
\Config\ScopeConfigInterface::class);
24
25
$this->model = new \Magento\Checkout\Block\Checkout\TotalsProcessor($this->scopeConfigMock);
26
}
27
28
public
function
testProcess
()
29
{
30
$jsLayoutData = [
31
'sub-total'
=> [],
32
'grand-total'
=> [],
33
'non-existant-total'
=> null
34
];
35
$expectedResultData = [
36
'sub-total'
=> [
'sortOrder'
=> 10],
37
'grand-total'
=> [
'sortOrder'
=> 20],
38
'non-existant-total'
=> null
39
];
40
$jsLayout[
'components'
][
'checkout'
][
'children'
][
'sidebar'
][
'children'
][
'summary'
]
41
[
'children'
][
'totals'
][
'children'
] = $jsLayoutData;
42
$expectedResult[
'components'
][
'checkout'
][
'children'
][
'sidebar'
][
'children'
][
'summary'
]
43
[
'children'
][
'totals'
][
'children'
] = $expectedResultData;
44
45
$configData
= [
'sub_total'
=> 10,
'grand_total'
=> 20];
46
47
$this->scopeConfigMock->expects($this->once())->method(
'getValue'
)->with(
'sales/totals_sort'
)
48
->willReturn(
$configData
);
49
50
$this->assertEquals($expectedResult, $this->model->process($jsLayout));
51
}
52
}
Magento\Framework\App
Magento\Checkout\Test\Unit\Block\Checkout
Definition:
DirectoryDataProcessorTest.php:6
Magento\Checkout\Test\Unit\Block\Checkout\TotalsProcessorTest\$model
$model
Definition:
TotalsProcessorTest.php:14
Magento\Checkout\Test\Unit\Block\Checkout\TotalsProcessorTest\$scopeConfigMock
$scopeConfigMock
Definition:
TotalsProcessorTest.php:19
$configData
$configData
Definition:
payment_configuration.php:26
Magento\Checkout\Test\Unit\Block\Checkout\TotalsProcessorTest\testProcess
testProcess()
Definition:
TotalsProcessorTest.php:28
Magento\Checkout\Test\Unit\Block\Checkout\TotalsProcessorTest\setUp
setUp()
Definition:
TotalsProcessorTest.php:21
Magento
Magento\Checkout\Test\Unit\Block\Checkout\TotalsProcessorTest
Definition:
TotalsProcessorTest.php:9