Skip to content

Commit 1542e55

Browse files
MAGETWO-98844: Maximum price is 100,000,000
1 parent b6e2d4a commit 1542e55

File tree

1 file changed

+43
-17
lines changed

1 file changed

+43
-17
lines changed

dev/tests/integration/testsuite/Magento/AdvancedPricingImportExport/Model/Export/AdvancedPricingTest.php

Lines changed: 43 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -19,23 +19,25 @@
1919

2020
/**
2121
* Advanced pricing test
22+
*
23+
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
2224
*/
2325
class AdvancedPricingTest extends TestCase
2426
{
2527
/**
26-
* @var \Magento\AdvancedPricingImportExport\Model\Export\AdvancedPricing
28+
* @var ExportAdvancedPricing
2729
*/
28-
protected $model;
30+
private $model;
2931

3032
/**
3133
* @var \Magento\Framework\ObjectManagerInterface
3234
*/
33-
protected $objectManager;
35+
private $objectManager;
3436

3537
/**
36-
* @var \Magento\Framework\Filesystem
38+
* @var Filesystem
3739
*/
38-
protected $fileSystem;
40+
private $fileSystem;
3941

4042
// @codingStandardsIgnoreStart
4143
public static function setUpBeforeClass()
@@ -53,6 +55,9 @@ public static function setUpBeforeClass()
5355
}
5456
// @codingStandardsIgnoreEnd
5557

58+
/**
59+
* @inheritdoc
60+
*/
5661
protected function setUp()
5762
{
5863
parent::setUp();
@@ -63,12 +68,15 @@ protected function setUp()
6368
}
6469

6570
/**
71+
* Export test
72+
*
6673
* @magentoAppArea adminhtml
6774
* @magentoDbIsolation disabled
6875
* @magentoAppIsolation enabled
6976
* @magentoDataFixture Magento/Catalog/_files/product_simple.php
77+
* @return void
7078
*/
71-
public function testExport()
79+
public function testExport(): void
7280
{
7381
$productRepository = $this->objectManager->create(ProductRepositoryInterface::class);
7482
$index = 0;
@@ -107,7 +115,7 @@ public function testExport()
107115
* @param string $exportContent
108116
* @return void
109117
*/
110-
private function assertDiscountTypes($exportContent)
118+
private function assertDiscountTypes(string $exportContent): void
111119
{
112120
$this->assertContains(
113121
'2.0000,8.000000,Fixed',
@@ -120,13 +128,16 @@ private function assertDiscountTypes($exportContent)
120128
}
121129

122130
/**
131+
* Export multiple websites test
132+
*
123133
* @magentoAppArea adminhtml
124134
* @magentoDbIsolation disabled
125135
* @magentoAppIsolation enabled
126136
* @magentoConfigFixture current_store catalog/price/scope 1
127137
* @magentoDataFixture Magento/AdvancedPricingImportExport/_files/product_with_second_website.php
138+
* @return void
128139
*/
129-
public function testExportMultipleWebsites()
140+
public function testExportMultipleWebsites(): void
130141
{
131142
$productRepository = $this->objectManager->create(ProductRepositoryInterface::class);
132143
$index = 0;
@@ -162,17 +173,18 @@ public function testExportMultipleWebsites()
162173
}
163174

164175
/**
176+
* Data export
177+
*
165178
* @param string $csvFile
166179
* @return string
167180
*/
168-
private function exportData($csvFile)
181+
private function exportData(string $csvFile): string
169182
{
170183
$this->model->setWriter(
171-
Bootstrap::getObjectManager()
172-
->create(
173-
ExportAdapterCsv::class,
174-
['fileSystem' => $this->fileSystem, 'destination' => $csvFile]
175-
)
184+
$this->objectManager->create(
185+
ExportAdapterCsv::class,
186+
['fileSystem' => $this->fileSystem, 'destination' => $csvFile]
187+
)
176188
);
177189
$exportContent = $this->model->export();
178190
$this->assertNotEmpty($exportContent);
@@ -181,9 +193,12 @@ private function exportData($csvFile)
181193
}
182194

183195
/**
196+
* Data import
197+
*
184198
* @param string $csvFile
199+
* @return void
185200
*/
186-
private function importData($csvFile)
201+
private function importData(string $csvFile): void
187202
{
188203
/** @var ImportAdvancedPricing $importModel */
189204
$importModel = $this->objectManager->create(ImportAdvancedPricing::class);
@@ -211,8 +226,19 @@ private function importData($csvFile)
211226
$importModel->importData();
212227
}
213228

214-
private function assertEqualsOtherThanSkippedAttributes($expected, $actual, $skippedAttributes)
215-
{
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 {
216242
foreach ($expected as $key => $value) {
217243
if (in_array($key, $skippedAttributes)) {
218244
continue;

0 commit comments

Comments
 (0)