File tree 5 files changed +12
-23
lines changed
Controller/Adminhtml/Order
Unit/Controller/Adminhtml/Order
Shipping/Controller/Adminhtml/Order
5 files changed +12
-23
lines changed Original file line number Diff line number Diff line change 8
8
9
9
use Magento \Framework \DataObject ;
10
10
use Magento \Sales \Api \CreditmemoRepositoryInterface ;
11
- use \Magento \Sales \Model \Order \CreditmemoFactory ;
11
+ use Magento \Sales \Model \Order ;
12
+ use Magento \Sales \Model \Order \CreditmemoFactory ;
12
13
13
14
/**
14
- * Class CreditmemoLoader
15
+ * Loader for creditmemo
15
16
*
16
- * @package Magento\Sales\Controller\Adminhtml\Order
17
17
* @method CreditmemoLoader setCreditmemoId($id)
18
18
* @method CreditmemoLoader setCreditmemo($creditMemo)
19
19
* @method CreditmemoLoader setInvoiceId($id)
22
22
* @method string getCreditmemo()
23
23
* @method int getInvoiceId()
24
24
* @method int getOrderId()
25
+ * @SuppressWarnings(PHPMD.CookieAndSessionMisuse)
25
26
*/
26
27
class CreditmemoLoader extends DataObject
27
28
{
@@ -129,7 +130,8 @@ protected function _getItemData()
129
130
130
131
/**
131
132
* Check if creditmeno can be created for order
132
- * @param \Magento\Sales\Model\Order $order
133
+ *
134
+ * @param Order $order
133
135
* @return bool
134
136
*/
135
137
protected function _canCreditmemo ($ order )
@@ -153,7 +155,9 @@ protected function _canCreditmemo($order)
153
155
}
154
156
155
157
/**
156
- * @param \Magento\Sales\Model\Order $order
158
+ * Inits invoice
159
+ *
160
+ * @param Order $order
157
161
* @return $this|bool
158
162
*/
159
163
protected function _initInvoice ($ order )
Original file line number Diff line number Diff line change 33
33
34
34
<seeInCurrentUrl url =" {{AdminCreditMemosGridPage.url}}" stepKey =" redirectToCreditMemosGridPage" />
35
35
36
- <see selector =" {{AdminMessagesSection.error}}" userInput =' This creditmemo no longer exists.'
37
- stepKey =" seeErrorMessage" />
36
+ <actionGroup ref =" AssertAdminPageIs404ActionGroup" stepKey =" see404PageOnAdmin" />
38
37
</test >
39
38
</tests >
Original file line number Diff line number Diff line change @@ -143,9 +143,6 @@ class ViewTest extends TestCase
143
143
*/
144
144
protected function setUp (): void
145
145
{
146
- $ titleMock = $ this ->getMockBuilder (\Magento \Framework \App \Action \Title::class)
147
- ->disableOriginalConstructor ()
148
- ->getMock ();
149
146
$ this ->invoiceMock = $ this ->getMockBuilder (Invoice::class)
150
147
->disableOriginalConstructor ()
151
148
->getMock ();
@@ -238,9 +235,6 @@ protected function setUp(): void
238
235
$ this ->contextMock ->expects ($ this ->any ())
239
236
->method ('getObjectManager ' )
240
237
->willReturn ($ this ->objectManagerMock );
241
- $ this ->contextMock ->expects ($ this ->any ())
242
- ->method ('getTitle ' )
243
- ->willReturn ($ titleMock );
244
238
$ this ->contextMock ->expects ($ this ->any ())
245
239
->method ('getMessageManager ' )
246
240
->willReturn ($ this ->messageManagerMock );
@@ -272,7 +266,7 @@ public function testExecuteNoCreditMemo()
272
266
$ this ->loaderMock ->expects ($ this ->once ())
273
267
->method ('load ' )
274
268
->willReturn (false );
275
-
269
+
276
270
$ this ->prepareRedirect ();
277
271
$ this ->setPath ('sales/creditmemo ' );
278
272
$ this ->assertInstanceOf (
Original file line number Diff line number Diff line change @@ -127,10 +127,6 @@ protected function setUp(): void
127
127
->disableOriginalConstructor ()
128
128
->setMethods ([])
129
129
->getMock ();
130
- $ this ->titleMock = $ this ->getMockBuilder (\Magento \Framework \App \Action \Title::class)
131
- ->disableOriginalConstructor ()
132
- ->setMethods ([])
133
- ->getMock ();
134
130
$ this ->viewMock = $ this ->getMockBuilder (\Magento \Framework \App \View::class)
135
131
->disableOriginalConstructor ()
136
132
->setMethods ([])
@@ -176,9 +172,6 @@ protected function setUp(): void
176
172
$ contextMock ->expects ($ this ->any ())
177
173
->method ('getResponse ' )
178
174
->willReturn ($ this ->responseMock );
179
- $ contextMock ->expects ($ this ->any ())
180
- ->method ('getTitle ' )
181
- ->willReturn ($ this ->titleMock );
182
175
$ contextMock ->expects ($ this ->any ())
183
176
->method ('getView ' )
184
177
->willReturn ($ this ->viewMock );
Original file line number Diff line number Diff line change 18
18
use Magento \Sales \Api \Data \ShipmentItemCreationInterface ;
19
19
20
20
/**
21
- * Class ShipmentLoader
21
+ * Loader for shipment
22
22
*
23
- * @package Magento\Shipping\Controller\Adminhtml\Order
24
23
* @method ShipmentLoader setOrderId($id)
25
24
* @method ShipmentLoader setShipmentId($id)
26
25
* @method ShipmentLoader setShipment($shipment)
You can’t perform that action at this time.
0 commit comments