Skip to content

Commit 86b593a

Browse files
MTA-3901: Add variation for Partial Refund an order placed through Braintree with Partial capture
1 parent 1e6babc commit 86b593a

File tree

6 files changed

+25
-28
lines changed

6 files changed

+25
-28
lines changed

dev/tests/functional/tests/app/Magento/Sales/Test/Block/Adminhtml/Order/AbstractForm.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,8 @@ public function fillProductData(array $data, $products = null)
6969
$data = $this->prepareData($data);
7070
if (isset($data['items_data']) && $products !== null) {
7171
foreach ($data['items_data'] as $key => $item) {
72-
$this->getItemsBlock()->getItemProductBlock($products[$key])->fillProduct($item);
72+
$productSku = $products[$key]->getData()['sku'];
73+
$this->getItemsBlock()->getItemProductBlock($productSku)->fillProduct($item);
7374
}
7475
}
7576
}

dev/tests/functional/tests/app/Magento/Sales/Test/Block/Adminhtml/Order/AbstractItemsNewBlock.php

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -8,38 +8,36 @@
88

99
use Magento\Sales\Test\Block\Adminhtml\Order\AbstractForm\Product;
1010
use Magento\Mtf\Block\Block;
11-
use Magento\Mtf\Fixture\FixtureInterface;
1211

1312
/**
14-
* Class AbstractItemsNewBlock
15-
* Items block on Credit Memo, Invoice, Shipment new pages
13+
* Items block on Credit Memo, Invoice, Shipment new pages.
1614
*/
1715
abstract class AbstractItemsNewBlock extends Block
1816
{
1917
/**
20-
* Item product row selector
18+
* Item product row selector.
2119
*
2220
* @var string
2321
*/
2422
protected $productItem = '//tr[contains(.,"%s")]';
2523

2624
/**
27-
* 'Update Qty's' button css selector
25+
* 'Update Qty's' button css selector.
2826
*
2927
* @var string
3028
*/
3129
protected $updateQty = '.update-button';
3230

3331
/**
34-
* Get item product block
32+
* Get item product block.
3533
*
36-
* @param FixtureInterface $product
34+
* @param string $productSku
3735
* @return Product
3836
*/
39-
abstract public function getItemProductBlock(FixtureInterface $product);
37+
abstract public function getItemProductBlock($productSku);
4038

4139
/**
42-
* Click update qty button
40+
* Click update qty button.
4341
*
4442
* @return void
4543
*/

dev/tests/functional/tests/app/Magento/Sales/Test/Block/Adminhtml/Order/Creditmemo/Form/Items.php

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
use Magento\Sales\Test\Block\Adminhtml\Order\Creditmemo\Form\Items\Product;
1010
use Magento\Mtf\Block\Block;
1111
use Magento\Mtf\Client\Locator;
12-
use Magento\Mtf\Fixture\FixtureInterface;
1312

1413
/**
1514
* Credit Memo Items block on Credit Memo new page.
@@ -33,12 +32,12 @@ class Items extends Block
3332
/**
3433
* Get item product block.
3534
*
36-
* @param FixtureInterface $product
35+
* @param string $productSku
3736
* @return Product
3837
*/
39-
public function getItemProductBlock(FixtureInterface $product)
38+
public function getItemProductBlock($productSku)
4039
{
41-
$selector = sprintf($this->productItems, $product->getData()['sku']);
40+
$selector = sprintf($this->productItems, $productSku);
4241
return $this->blockFactory->create(
4342
\Magento\Sales\Test\Block\Adminhtml\Order\Creditmemo\Form\Items\Product::class,
4443
['element' => $this->_rootElement->find($selector, Locator::SELECTOR_XPATH)]

dev/tests/functional/tests/app/Magento/Sales/Test/Block/Adminhtml/Order/Invoice/Form/Items.php

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,23 +9,21 @@
99
use Magento\Sales\Test\Block\Adminhtml\Order\AbstractItemsNewBlock;
1010
use Magento\Sales\Test\Block\Adminhtml\Order\Invoice\Form\Items\Product;
1111
use Magento\Mtf\Client\Locator;
12-
use Magento\Mtf\Fixture\FixtureInterface;
1312

1413
/**
15-
* Class Items
16-
* Block for items to invoice on new invoice page
14+
* Block for items to invoice on new invoice page.
1715
*/
1816
class Items extends AbstractItemsNewBlock
1917
{
2018
/**
21-
* Get item product block
19+
* Get item product block.
2220
*
23-
* @param FixtureInterface $product
21+
* @param string $productSku
2422
* @return Product
2523
*/
26-
public function getItemProductBlock(FixtureInterface $product)
24+
public function getItemProductBlock($productSku)
2725
{
28-
$selector = sprintf($this->productItem, $product->getSku());
26+
$selector = sprintf($this->productItem, $productSku);
2927
return $this->blockFactory->create(
3028
\Magento\Sales\Test\Block\Adminhtml\Order\Invoice\Form\Items\Product::class,
3129
['element' => $this->_rootElement->find($selector, Locator::SELECTOR_XPATH)]

dev/tests/functional/tests/app/Magento/Sales/Test/TestStep/CreateOnlineCreditMemoStep.php

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -60,13 +60,15 @@ class CreateOnlineCreditMemoStep implements TestStepInterface
6060
* @var OrderInvoiceView
6161
*/
6262
private $orderInvoiceView;
63+
6364
/**
65+
* Checkout Cart fixture.
66+
*
6467
* @var Cart
6568
*/
6669
private $cart;
6770

6871
/**
69-
* @construct
7072
* @param Cart $cart
7173
* @param OrderIndex $orderIndex
7274
* @param SalesOrderView $salesOrderView
@@ -84,13 +86,13 @@ public function __construct(
8486
OrderCreditMemoNew $orderCreditMemoNew,
8587
$refundData = null
8688
) {
89+
$this->cart = $cart;
8790
$this->orderIndex = $orderIndex;
8891
$this->salesOrderView = $salesOrderView;
8992
$this->order = $order;
93+
$this->orderInvoiceView = $orderInvoiceView;
9094
$this->orderCreditMemoNew = $orderCreditMemoNew;
9195
$this->refundData = $refundData;
92-
$this->orderInvoiceView = $orderInvoiceView;
93-
$this->cart = $cart;
9496
}
9597

9698
/**

dev/tests/functional/tests/app/Magento/Shipping/Test/Block/Adminhtml/Form/Items.php

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
use Magento\Sales\Test\Block\Adminhtml\Order\AbstractItemsNewBlock;
1010
use Magento\Shipping\Test\Block\Adminhtml\Form\Items\Product;
1111
use Magento\Mtf\Client\Locator;
12-
use Magento\Mtf\Fixture\FixtureInterface;
1312

1413
/**
1514
* Adminhtml items to ship block.
@@ -19,12 +18,12 @@ class Items extends AbstractItemsNewBlock
1918
/**
2019
* Get item product block.
2120
*
22-
* @param FixtureInterface $product
21+
* @param string $productSku
2322
* @return Product
2423
*/
25-
public function getItemProductBlock(FixtureInterface $product)
24+
public function getItemProductBlock($productSku)
2625
{
27-
$selector = sprintf($this->productItem, $product->getSku());
26+
$selector = sprintf($this->productItem, $productSku);
2827
return $this->blockFactory->create(
2928
\Magento\Shipping\Test\Block\Adminhtml\Form\Items\Product::class,
3029
['element' => $this->_rootElement->find($selector, Locator::SELECTOR_XPATH)]

0 commit comments

Comments
 (0)