12
12
use Magento \Store \Test \Fixture \Store ;
13
13
use Magento \Mtf \Fixture \FixtureFactory ;
14
14
use Magento \Mtf \TestCase \Injectable ;
15
+ use Magento \Mtf \TestStep \TestStepFactory ;
15
16
16
17
/**
17
18
* Preconditions:
@@ -59,19 +60,36 @@ class UpdateCustomVariableEntityTest extends Injectable
59
60
*/
60
61
protected $ store = null ;
61
62
63
+ /**
64
+ * Configuration setting.
65
+ *
66
+ * @var string
67
+ */
68
+ private $ configData ;
69
+
70
+ /**
71
+ * Factory for Test Steps.
72
+ *
73
+ * @var TestStepFactory
74
+ */
75
+ private $ testStepFactory ;
76
+
62
77
/**
63
78
* Injection data.
64
79
*
65
80
* @param SystemVariableIndex $systemVariableIndex
66
81
* @param SystemVariableNew $systemVariableNew
82
+ * @param TestStepFactory $testStepFactory
67
83
* @return void
68
84
*/
69
85
public function __inject (
70
86
SystemVariableIndex $ systemVariableIndex ,
71
- SystemVariableNew $ systemVariableNew
87
+ SystemVariableNew $ systemVariableNew ,
88
+ TestStepFactory $ testStepFactory
72
89
) {
73
90
$ this ->systemVariableIndexPage = $ systemVariableIndex ;
74
91
$ this ->systemVariableNewPage = $ systemVariableNew ;
92
+ $ this ->testStepFactory = $ testStepFactory ;
75
93
}
76
94
77
95
/**
@@ -81,14 +99,22 @@ public function __inject(
81
99
* @param SystemVariable $customVariable
82
100
* @param SystemVariable $customVariableOrigin
83
101
* @param string $saveAction
102
+ * @param string|null $configData [optional]
84
103
* @return array
85
104
*/
86
105
public function test (
87
106
FixtureFactory $ fixtureFactory ,
88
107
SystemVariable $ customVariable ,
89
108
SystemVariable $ customVariableOrigin ,
90
- $ saveAction
109
+ $ saveAction ,
110
+ $ configData = null
91
111
) {
112
+ // Preconditions
113
+ $ this ->configData = $ configData ;
114
+ $ this ->testStepFactory ->create (
115
+ \Magento \Config \Test \TestStep \SetupConfigurationStep::class,
116
+ ['configData ' => $ this ->configData ]
117
+ )->run ();
92
118
$ this ->store = $ fixtureFactory ->createByCode ('store ' , ['dataset ' => 'custom ' ]);
93
119
$ this ->store ->persist ();
94
120
$ customVariableOrigin ->persist ();
0 commit comments