Skip to content

Commit 8cf1e27

Browse files
MC-36907: Storefront: Create reorder from customer profile page.
1 parent ff4e86a commit 8cf1e27

File tree

2 files changed

+37
-1
lines changed
  • dev/tests/integration

2 files changed

+37
-1
lines changed
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
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\TestFramework\Core\Version;
9+
10+
/**
11+
* Class for magento version flag.
12+
*/
13+
class View
14+
{
15+
/**
16+
* Returns flag that checks that magento version is clean community version.
17+
*
18+
* @return bool
19+
*/
20+
public function isVersionUpdated(): bool
21+
{
22+
return false;
23+
}
24+
}

dev/tests/integration/testsuite/Magento/Sales/Controller/Order/ReorderTest.php

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
use Magento\Quote\Api\CartRepositoryInterface;
1515
use Magento\Quote\Api\Data\CartInterface;
1616
use Magento\Sales\Api\Data\OrderInterfaceFactory;
17+
use Magento\TestFramework\Core\Version\View;
1718
use Magento\TestFramework\Request;
1819
use Magento\TestFramework\TestCase\AbstractController;
1920

@@ -44,6 +45,11 @@ class ReorderTest extends AbstractController
4445
/** @var Escaper */
4546
private $escaper;
4647

48+
/**
49+
* @var View
50+
*/
51+
private $versionChecker;
52+
4753
/**
4854
* @inheritdoc
4955
*/
@@ -56,6 +62,7 @@ protected function setUp(): void
5662
$this->customerSession = $this->_objectManager->get(Session::class);
5763
$this->quoteRepository = $this->_objectManager->get(CartRepositoryInterface::class);
5864
$this->escaper = $this->_objectManager->get(Escaper::class);
65+
$this->versionChecker = $this->_objectManager->get(View::class);
5966
}
6067

6168
/**
@@ -121,7 +128,12 @@ public function testReorderByAnotherCustomer(): void
121128
$this->customerSession->setCustomerId(1);
122129
$order = $this->orderFactory->create()->loadByIncrementId('100000555');
123130
$this->dispatchReorderRequest((int)$order->getId());
124-
$this->assertRedirect($this->stringContains('sales/order/history'));
131+
132+
if ($this->versionChecker->isVersionUpdated()) {
133+
$this->assertRedirect($this->stringContains('noroute'));
134+
} else {
135+
$this->assertRedirect($this->stringContains('sales/order/history'));
136+
}
125137
}
126138

127139
/**

0 commit comments

Comments
 (0)