Skip to content

Commit 91e9246

Browse files
MTA-3610: Add variations for offline payment methods in CreateInvoiceEntityTest
1 parent 44803cc commit 91e9246

File tree

1 file changed

+23
-6
lines changed

1 file changed

+23
-6
lines changed

dev/tests/functional/tests/app/Magento/Sales/Test/TestCase/CreateInvoiceEntityTest.php

Lines changed: 23 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313
/**
1414
* Preconditions:
15-
* 1. Enable payment method one of "Check/Money Order/Bank Transfer/Cash on Delivery/Purchase Order/Zero Subtotal Checkout".
15+
* 1. Enable payment method: "Check/Money Order/Bank Transfer/Cash on Delivery/Purchase Order/Zero Subtotal Checkout".
1616
* 2. Enable shipping method one of "Flat Rate/Free Shipping".
1717
* 3. Create order.
1818
*
@@ -33,26 +33,43 @@ class CreateInvoiceEntityTest extends Injectable
3333
const MVP = 'yes';
3434
/* end tags */
3535

36+
/**
37+
* Factory for Test Steps.
38+
*
39+
* @var TestStepFactory
40+
*/
41+
protected $stepFactory;
42+
43+
/**
44+
* Prepare data.
45+
*
46+
* @param TestStepFactory $stepFactory
47+
* @return void
48+
*/
49+
public function __prepare(TestStepFactory $stepFactory)
50+
{
51+
$this->stepFactory = $stepFactory;
52+
}
53+
3654
/**
3755
* Create invoice.
3856
*
3957
* @param OrderInjectable $order
40-
* @param TestStepFactory $stepFactory
4158
* @param array $data
4259
* @param string $configData
4360
* @return array
4461
*/
45-
public function test(OrderInjectable $order, TestStepFactory $stepFactory, array $data, $configData)
62+
public function test(OrderInjectable $order, array $data, $configData)
4663
{
4764
// Preconditions
48-
$stepFactory->create(
65+
$this->stepFactory->create(
4966
\Magento\Config\Test\TestStep\SetupConfigurationStep::class,
5067
['configData' => $configData]
5168
)->run();
5269
$order->persist();
5370

5471
// Steps
55-
$result = $stepFactory->create(
72+
$result = $this->stepFactory->create(
5673
\Magento\Sales\Test\TestStep\CreateInvoiceStep::class,
5774
['order' => $order, 'data' => $data]
5875
)->run();
@@ -67,6 +84,6 @@ public function test(OrderInjectable $order, TestStepFactory $stepFactory, array
6784
*/
6885
public function tearDown()
6986
{
70-
$this->objectManager->create(\Magento\Customer\Test\TestStep\LogoutCustomerOnFrontendStep::class)->run();
87+
$this->stepFactory->create(\Magento\Customer\Test\TestStep\LogoutCustomerOnFrontendStep::class)->run();
7188
}
7289
}

0 commit comments

Comments
 (0)