12
12
13
13
/**
14
14
* 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".
16
16
* 2. Enable shipping method one of "Flat Rate/Free Shipping".
17
17
* 3. Create order.
18
18
*
@@ -33,26 +33,43 @@ class CreateInvoiceEntityTest extends Injectable
33
33
const MVP = 'yes ' ;
34
34
/* end tags */
35
35
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
+
36
54
/**
37
55
* Create invoice.
38
56
*
39
57
* @param OrderInjectable $order
40
- * @param TestStepFactory $stepFactory
41
58
* @param array $data
42
59
* @param string $configData
43
60
* @return array
44
61
*/
45
- public function test (OrderInjectable $ order , TestStepFactory $ stepFactory , array $ data , $ configData )
62
+ public function test (OrderInjectable $ order , array $ data , $ configData )
46
63
{
47
64
// Preconditions
48
- $ stepFactory ->create (
65
+ $ this -> stepFactory ->create (
49
66
\Magento \Config \Test \TestStep \SetupConfigurationStep::class,
50
67
['configData ' => $ configData ]
51
68
)->run ();
52
69
$ order ->persist ();
53
70
54
71
// Steps
55
- $ result = $ stepFactory ->create (
72
+ $ result = $ this -> stepFactory ->create (
56
73
\Magento \Sales \Test \TestStep \CreateInvoiceStep::class,
57
74
['order ' => $ order , 'data ' => $ data ]
58
75
)->run ();
@@ -67,6 +84,6 @@ public function test(OrderInjectable $order, TestStepFactory $stepFactory, array
67
84
*/
68
85
public function tearDown ()
69
86
{
70
- $ this ->objectManager ->create (\Magento \Customer \Test \TestStep \LogoutCustomerOnFrontendStep::class)->run ();
87
+ $ this ->stepFactory ->create (\Magento \Customer \Test \TestStep \LogoutCustomerOnFrontendStep::class)->run ();
71
88
}
72
89
}
0 commit comments