File tree Expand file tree Collapse file tree 2 files changed +32
-5
lines changed
app/code/Magento/Sales/Controller/Guest
dev/tests/integration/testsuite/Magento/Sales/Controller/Guest Expand file tree Collapse file tree 2 files changed +32
-5
lines changed Original file line number Diff line number Diff line change @@ -53,11 +53,10 @@ public function __construct(
53
53
*/
54
54
public function execute ()
55
55
{
56
- if (!$ this ->getRequest ()->isPost ()) {
57
- throw new \Magento \Framework \Exception \NotFoundException (__ ('Page not found. ' ));
58
- }
59
- if (!$ this ->formKeyValidator ->validate ($ this ->getRequest ())) {
60
- return $ this ->resultRedirectFactory ->create ()->setPath ('*/*/form/ ' );
56
+ if ($ this ->getRequest ()->isPost ()) {
57
+ if (!$ this ->formKeyValidator ->validate ($ this ->getRequest ())) {
58
+ return $ this ->resultRedirectFactory ->create ()->setPath ('*/*/form/ ' );
59
+ }
61
60
}
62
61
63
62
$ result = $ this ->guestHelper ->loadValidOrder ($ this ->getRequest ());
Original file line number Diff line number Diff line change
1
+ <?php
2
+ /**
3
+ * Copyright © Magento, Inc. All rights reserved.
4
+ * See COPYING.txt for license details.
5
+ */
6
+ declare (strict_types=1 );
7
+
8
+ namespace Magento \Sales \Controller \Guest ;
9
+
10
+ use Magento \TestFramework \Request ;
11
+ use Magento \TestFramework \TestCase \AbstractController ;
12
+
13
+ /**
14
+ * Test for \Magento\Sales\Controller\Guest\View class.
15
+ */
16
+ class ViewTest extends AbstractController
17
+ {
18
+ /**
19
+ * Check that controller applied GET requests.
20
+ */
21
+ public function testExecuteWithGetRequest ()
22
+ {
23
+ $ this ->getRequest ()->setMethod (Request::METHOD_GET );
24
+ $ this ->dispatch ('sales/guest/view/ ' );
25
+
26
+ $ this ->assertRedirect ($ this ->stringContains ('sales/guest/form ' ));
27
+ }
28
+ }
You can’t perform that action at this time.
0 commit comments