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-reports
Test
Unit
Controller
Adminhtml
Report
Customer
AccountsTest.php
Go to the documentation of this file.
1
<?php
7
namespace
Magento\Reports\Test\Unit\Controller\Adminhtml\Report\Customer
;
8
9
use
Magento\Reports\Controller\Adminhtml\Report\Customer\Accounts
;
10
use
Magento\Framework\DataObject
;
11
use
Magento\Framework\Phrase
;
12
13
class
AccountsTest
extends
\Magento\Reports\Test\Unit\Controller\Adminhtml\Report\AbstractControllerTest
14
{
18
protected
$accounts
;
19
23
protected
function
setUp
()
24
{
25
parent::setUp();
26
27
$this->accounts =
new
Accounts
(
28
$this->contextMock,
29
$this->fileFactoryMock
30
);
31
}
32
36
public
function
testExecute
()
37
{
38
$titleMock = $this->getMockBuilder(\
Magento
\Framework\View\Page\Title::class)
39
->disableOriginalConstructor()
40
->getMock();
41
$titleMock
42
->expects($this->once())
43
->method(
'prepend'
)
44
->with(
new
Phrase
(
'New Accounts Report'
));
45
46
$this->viewMock
47
->expects($this->any())
48
->method(
'getPage'
)
49
->willReturn(
50
new
DataObject
(
51
[
'config'
=>
new
DataObject
(
52
[
'title'
=> $titleMock]
53
)]
54
)
55
);
56
57
$this->menuBlockMock
58
->expects($this->once())
59
->method(
'setActive'
)
60
->with(
'Magento_Reports::report_customers_accounts'
);
61
$this->breadcrumbsBlockMock
62
->expects($this->at(0))
63
->method(
'addLink'
)
64
->with(
new
Phrase
(
'Reports'
),
new
Phrase
(
'Reports'
));
65
$this->breadcrumbsBlockMock
66
->expects($this->at(1))
67
->method(
'addLink'
)
68
->with(
new
Phrase
(
'Customers'
),
new
Phrase
(
'Customers'
));
69
$this->breadcrumbsBlockMock
70
->expects($this->at(2))
71
->method(
'addLink'
)
72
->with(
new
Phrase
(
'New Accounts'
),
new
Phrase
(
'New Accounts'
));
73
$this->accounts->execute();
74
}
75
}
Magento\Reports\Test\Unit\Controller\Adminhtml\Report\Customer
Definition:
AccountsTest.php:7
Magento\Reports\Test\Unit\Controller\Adminhtml\Report\Customer\AccountsTest\setUp
setUp()
Definition:
AccountsTest.php:23
Magento\Reports\Test\Unit\Controller\Adminhtml\Report\Customer\AccountsTest
Definition:
AccountsTest.php:13
Magento\Reports\Test\Unit\Controller\Adminhtml\Report\AbstractControllerTest
Definition:
AbstractControllerTest.php:12
Magento\Reports\Controller\Adminhtml\Report\Customer\Accounts
Definition:
Accounts.php:11
Magento\Framework\DataObject
Definition:
DataObject.php:15
Magento\Reports\Test\Unit\Controller\Adminhtml\Report\Customer\AccountsTest\testExecute
testExecute()
Definition:
AccountsTest.php:36
Magento
Magento\Framework\Phrase
Definition:
Phrase.php:17
Magento\Framework\Phrase
Magento\Reports\Test\Unit\Controller\Adminhtml\Report\Customer\AccountsTest\$accounts
$accounts
Definition:
AccountsTest.php:18
Magento\Framework\DataObject
Definition:
Cache.php:6