1
1
<?php
2
2
/**
3
- * Copyright © Magento, Inc. All rights reserved.
4
- * See COPYING.txt for license details .
3
+ * Copyright 2013 Adobe
4
+ * All Rights Reserved .
5
5
*/
6
6
declare (strict_types=1 );
7
7
8
8
namespace Magento \Email \Test \Unit \Block \Adminhtml \Template ;
9
9
10
+ use Magento \Backend \Block \Template \Context ;
11
+ use Magento \Backend \Model \Menu \Item \Factory ;
10
12
use Magento \Backend \Helper \Data ;
11
13
use Magento \Backend \Model \Menu ;
12
14
use Magento \Backend \Model \Menu \Config ;
21
23
use Magento \Framework \App \Filesystem \DirectoryList ;
22
24
use Magento \Framework \Filesystem ;
23
25
use Magento \Framework \Filesystem \Directory \Read ;
26
+ use Magento \Framework \Serialize \SerializerInterface ;
24
27
use Magento \Framework \TestFramework \Unit \Helper \ObjectManager ;
25
28
use Magento \Framework \View \FileSystem as FilesystemView ;
26
29
use Magento \Framework \View \Layout ;
30
+ use Magento \Store \Model \StoreManagerInterface ;
27
31
use PHPUnit \Framework \MockObject \MockObject ;
28
32
use PHPUnit \Framework \TestCase ;
29
33
use Psr \Log \LoggerInterface ;
@@ -62,6 +66,11 @@ class EditTest extends TestCase
62
66
*/
63
67
protected $ filesystemMock ;
64
68
69
+ /**
70
+ * @var Context|MockObject
71
+ */
72
+ private Context $ context ;
73
+
65
74
protected function setUp (): void
66
75
{
67
76
$ objectManager = new ObjectManager ($ this );
@@ -72,8 +81,14 @@ protected function setUp(): void
72
81
$ helperMock = $ this ->createMock (Data::class);
73
82
$ menuConfigMock = $ this ->createMock (Config::class);
74
83
$ menuMock = $ this ->getMockBuilder (Menu::class)
75
- ->setConstructorArgs ([$ this ->getMockForAbstractClass (LoggerInterface::class)])
76
- ->getMock ();
84
+ ->setConstructorArgs (
85
+ [
86
+ $ this ->getMockForAbstractClass (LoggerInterface::class),
87
+ '' ,
88
+ $ this ->createMock (Factory::class),
89
+ $ this ->createMock (SerializerInterface::class)
90
+ ]
91
+ )->getMock ();
77
92
$ menuItemMock = $ this ->createMock (Item::class);
78
93
$ urlBuilder = $ this ->createMock (Url::class);
79
94
$ this ->_configStructureMock = $ this ->createMock (Structure::class);
@@ -96,6 +111,9 @@ protected function setUp(): void
96
111
)->willReturn (
97
112
DirectoryList::ROOT . '/custom/filename.phtml '
98
113
);
114
+ $ this ->context = $ this ->createMock (Context::class);
115
+ $ this ->context ->expects ($ this ->any ())->method ('getStoreManager ' )
116
+ ->willReturn ($ this ->createMock (StoreManagerInterface::class));
99
117
100
118
$ params = [
101
119
'urlBuilder ' => $ urlBuilder ,
@@ -105,6 +123,7 @@ protected function setUp(): void
105
123
'emailConfig ' => $ this ->_emailConfigMock ,
106
124
'filesystem ' => $ this ->filesystemMock ,
107
125
'viewFileSystem ' => $ viewFilesystem ,
126
+ 'context ' => $ this ->context
108
127
];
109
128
$ arguments = $ objectManager ->getConstructArguments (
110
129
Edit::class,
0 commit comments