@@ -65,55 +65,46 @@ class UpdateCustomVariableEntityTest extends Injectable
65
65
*
66
66
* @param SystemVariableIndex $systemVariableIndex
67
67
* @param SystemVariableNew $systemVariableNew
68
- * @param SystemVariable $customVariableOrigin
69
- * @param FixtureFactory $factory
70
- * @return array
68
+ * @return void
71
69
*/
72
70
public function __inject (
73
71
SystemVariableIndex $ systemVariableIndex ,
74
- SystemVariableNew $ systemVariableNew ,
75
- SystemVariable $ customVariableOrigin ,
76
- FixtureFactory $ factory
72
+ SystemVariableNew $ systemVariableNew
77
73
) {
78
74
$ this ->systemVariableIndexPage = $ systemVariableIndex ;
79
75
$ this ->systemVariableNewPage = $ systemVariableNew ;
80
-
81
- $ customVariableOrigin ->persist ();
82
-
83
- // TODO: Move store creation to "__prepare" method after fix bug MAGETWO-29331
84
- $ storeOrigin = $ factory ->createByCode ('store ' , ['dataset ' => 'custom ' ]);
85
- $ storeOrigin ->persist ();
86
- $ this ->store = $ storeOrigin ;
87
-
88
- return [
89
- 'customVariableOrigin ' => $ customVariableOrigin ,
90
- 'storeOrigin ' => $ storeOrigin
91
- ];
92
76
}
93
77
94
78
/**
95
79
* Update Custom System Variable Entity test.
96
80
*
81
+ * @param FixtureFactory $fixtureFactory
97
82
* @param SystemVariable $customVariable
98
83
* @param SystemVariable $customVariableOrigin
99
- * @param Store $storeOrigin
100
84
* @param string $saveAction
101
- * @return void
85
+ * @return array
102
86
*/
103
87
public function test (
88
+ FixtureFactory $ fixtureFactory ,
104
89
SystemVariable $ customVariable ,
105
90
SystemVariable $ customVariableOrigin ,
106
- Store $ storeOrigin ,
107
91
$ saveAction
108
92
) {
93
+ $ this ->store = $ fixtureFactory ->createByCode ('store ' , ['dataset ' => 'custom ' ]);
94
+ $ this ->store ->persist ();
95
+ $ customVariableOrigin ->persist ();
109
96
$ filter = ['code ' => $ customVariableOrigin ->getCode ()];
110
97
111
98
// Steps
112
99
$ this ->systemVariableIndexPage ->open ();
113
100
$ this ->systemVariableIndexPage ->getSystemVariableGrid ()->searchAndOpen ($ filter );
114
- $ this ->systemVariableNewPage ->getFormPageActions ()->selectStoreView ($ storeOrigin ->getData ('name ' ));
101
+ $ this ->systemVariableNewPage ->getFormPageActions ()->selectStoreView ($ this -> store ->getData ('name ' ));
115
102
$ this ->systemVariableNewPage ->getSystemVariableForm ()->fill ($ customVariable );
116
103
$ this ->systemVariableNewPage ->getFormPageActions ()->$ saveAction ();
104
+ return [
105
+ 'storeOrigin ' => $ this ->store ,
106
+ 'customVariableOrigin ' => $ customVariableOrigin
107
+ ];
117
108
}
118
109
119
110
/**
@@ -123,7 +114,6 @@ public function test(
123
114
*/
124
115
public function tearDown ()
125
116
{
126
- // TODO: Move store clean up to "tearDownAfterClass" method after fix bug MAGETWO-29331
127
117
if ($ this ->store !== null ) {
128
118
$ storeIndex = $ this ->objectManager ->create ('Magento\Backend\Test\Page\Adminhtml\StoreIndex ' );
129
119
$ storeIndex ->open ();
0 commit comments