19
19
20
20
/**
21
21
* Advanced pricing test
22
- *
23
- * @SuppressWarnings(PHPMD.CouplingBetweenObjects)
24
22
*/
25
23
class AdvancedPricingTest extends TestCase
26
24
{
27
25
/**
28
26
* @var ExportAdvancedPricing
29
27
*/
30
- private $ model ;
28
+ protected $ model ;
31
29
32
30
/**
33
31
* @var \Magento\Framework\ObjectManagerInterface
34
32
*/
35
- private $ objectManager ;
33
+ protected $ objectManager ;
36
34
37
35
/**
38
36
* @var Filesystem
39
37
*/
40
- private $ fileSystem ;
38
+ protected $ fileSystem ;
41
39
42
40
// @codingStandardsIgnoreStart
43
41
public static function setUpBeforeClass ()
@@ -55,9 +53,6 @@ public static function setUpBeforeClass()
55
53
}
56
54
// @codingStandardsIgnoreEnd
57
55
58
- /**
59
- * @inheritdoc
60
- */
61
56
protected function setUp ()
62
57
{
63
58
parent ::setUp ();
@@ -68,15 +63,12 @@ protected function setUp()
68
63
}
69
64
70
65
/**
71
- * Export test
72
- *
73
66
* @magentoAppArea adminhtml
74
67
* @magentoDbIsolation disabled
75
68
* @magentoAppIsolation enabled
76
69
* @magentoDataFixture Magento/Catalog/_files/product_simple.php
77
- * @return void
78
70
*/
79
- public function testExport (): void
71
+ public function testExport ()
80
72
{
81
73
$ productRepository = $ this ->objectManager ->create (ProductRepositoryInterface::class);
82
74
$ index = 0 ;
@@ -115,7 +107,7 @@ public function testExport(): void
115
107
* @param string $exportContent
116
108
* @return void
117
109
*/
118
- private function assertDiscountTypes (string $ exportContent ): void
110
+ private function assertDiscountTypes ($ exportContent )
119
111
{
120
112
$ this ->assertContains (
121
113
'2.0000,8.000000,Fixed ' ,
@@ -128,16 +120,13 @@ private function assertDiscountTypes(string $exportContent): void
128
120
}
129
121
130
122
/**
131
- * Export multiple websites test
132
- *
133
123
* @magentoAppArea adminhtml
134
124
* @magentoDbIsolation disabled
135
125
* @magentoAppIsolation enabled
136
126
* @magentoConfigFixture current_store catalog/price/scope 1
137
127
* @magentoDataFixture Magento/AdvancedPricingImportExport/_files/product_with_second_website.php
138
- * @return void
139
128
*/
140
- public function testExportMultipleWebsites (): void
129
+ public function testExportMultipleWebsites ()
141
130
{
142
131
$ productRepository = $ this ->objectManager ->create (ProductRepositoryInterface::class);
143
132
$ index = 0 ;
@@ -173,18 +162,17 @@ public function testExportMultipleWebsites(): void
173
162
}
174
163
175
164
/**
176
- * Data export
177
- *
178
165
* @param string $csvFile
179
166
* @return string
180
167
*/
181
- private function exportData (string $ csvFile ): string
168
+ private function exportData ($ csvFile )
182
169
{
183
170
$ this ->model ->setWriter (
184
- $ this ->objectManager ->create (
185
- ExportAdapterCsv::class,
186
- ['fileSystem ' => $ this ->fileSystem , 'destination ' => $ csvFile ]
187
- )
171
+ Bootstrap::getObjectManager ()
172
+ ->create (
173
+ ExportAdapterCsv::class,
174
+ ['fileSystem ' => $ this ->fileSystem , 'destination ' => $ csvFile ]
175
+ )
188
176
);
189
177
$ exportContent = $ this ->model ->export ();
190
178
$ this ->assertNotEmpty ($ exportContent );
@@ -193,12 +181,9 @@ private function exportData(string $csvFile): string
193
181
}
194
182
195
183
/**
196
- * Data import
197
- *
198
184
* @param string $csvFile
199
- * @return void
200
185
*/
201
- private function importData (string $ csvFile ): void
186
+ private function importData ($ csvFile )
202
187
{
203
188
/** @var ImportAdvancedPricing $importModel */
204
189
$ importModel = $ this ->objectManager ->create (ImportAdvancedPricing::class);
@@ -226,19 +211,8 @@ private function importData(string $csvFile): void
226
211
$ importModel ->importData ();
227
212
}
228
213
229
- /**
230
- * Assert equals other than skipped attributes
231
- *
232
- * @param array $expected
233
- * @param array $actual
234
- * @param array $skippedAttributes
235
- * @return void
236
- */
237
- private function assertEqualsOtherThanSkippedAttributes (
238
- array $ expected ,
239
- array $ actual ,
240
- array $ skippedAttributes
241
- ): void {
214
+ private function assertEqualsOtherThanSkippedAttributes ($ expected , $ actual , $ skippedAttributes )
215
+ {
242
216
foreach ($ expected as $ key => $ value ) {
243
217
if (in_array ($ key , $ skippedAttributes )) {
244
218
continue ;
0 commit comments