@@ -69,13 +69,16 @@ protected function setUp()
69
69
$ this ->resultRedirect = $ this ->getMockBuilder (\Magento \Framework \Controller \Result \Redirect::class)
70
70
->disableOriginalConstructor ()
71
71
->getMock ();
72
+ $ this ->request = $ this ->getMockBuilder (\Magento \Framework \App \RequestInterface::class)
73
+ ->getMockForAbstractClass ();
72
74
73
75
$ objectManager = new ObjectManagerHelper ($ this );
74
- $ this ->prepareContext ();
75
76
$ this ->model = $ objectManager ->getObject (
76
77
Delete::class,
77
78
[
78
- 'context ' => $ this ->context ,
79
+ 'request ' => $ this ->request ,
80
+ 'resultRedirectFactory ' => $ this ->resultRedirectFactory ,
81
+ 'messageManager ' => $ this ->messageManager ,
79
82
'customerSession ' => $ this ->sessionMock ,
80
83
'formKeyValidator ' => $ this ->validatorMock ,
81
84
'formFactory ' => $ formFactoryMock ,
@@ -84,25 +87,6 @@ protected function setUp()
84
87
);
85
88
}
86
89
87
- protected function prepareContext ()
88
- {
89
- $ this ->context = $ this ->getMockBuilder (\Magento \Framework \App \Action \Context::class)
90
- ->disableOriginalConstructor ()
91
- ->getMock ();
92
- $ this ->request = $ this ->getMockBuilder (\Magento \Framework \App \RequestInterface::class)
93
- ->getMockForAbstractClass ();
94
-
95
- $ this ->context ->expects ($ this ->any ())
96
- ->method ('getRequest ' )
97
- ->willReturn ($ this ->request );
98
- $ this ->context ->expects ($ this ->any ())
99
- ->method ('getResultRedirectFactory ' )
100
- ->willReturn ($ this ->resultRedirectFactory );
101
- $ this ->context ->expects ($ this ->any ())
102
- ->method ('getMessageManager ' )
103
- ->willReturn ($ this ->messageManager );
104
- }
105
-
106
90
public function testExecute ()
107
91
{
108
92
$ addressId = 1 ;
0 commit comments