Skip to content

Commit b71532e

Browse files
MAGETWO-98844: Maximum price is 100,000,000
1 parent fa88be6 commit b71532e

File tree

1 file changed

+15
-41
lines changed

1 file changed

+15
-41
lines changed

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

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

2020
/**
2121
* Advanced pricing test
22-
*
23-
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
2422
*/
2523
class AdvancedPricingTest extends TestCase
2624
{
2725
/**
2826
* @var ExportAdvancedPricing
2927
*/
30-
private $model;
28+
protected $model;
3129

3230
/**
3331
* @var \Magento\Framework\ObjectManagerInterface
3432
*/
35-
private $objectManager;
33+
protected $objectManager;
3634

3735
/**
3836
* @var Filesystem
3937
*/
40-
private $fileSystem;
38+
protected $fileSystem;
4139

4240
// @codingStandardsIgnoreStart
4341
public static function setUpBeforeClass()
@@ -55,9 +53,6 @@ public static function setUpBeforeClass()
5553
}
5654
// @codingStandardsIgnoreEnd
5755

58-
/**
59-
* @inheritdoc
60-
*/
6156
protected function setUp()
6257
{
6358
parent::setUp();
@@ -68,15 +63,12 @@ protected function setUp()
6863
}
6964

7065
/**
71-
* Export test
72-
*
7366
* @magentoAppArea adminhtml
7467
* @magentoDbIsolation disabled
7568
* @magentoAppIsolation enabled
7669
* @magentoDataFixture Magento/Catalog/_files/product_simple.php
77-
* @return void
7870
*/
79-
public function testExport(): void
71+
public function testExport()
8072
{
8173
$productRepository = $this->objectManager->create(ProductRepositoryInterface::class);
8274
$index = 0;
@@ -115,7 +107,7 @@ public function testExport(): void
115107
* @param string $exportContent
116108
* @return void
117109
*/
118-
private function assertDiscountTypes(string $exportContent): void
110+
private function assertDiscountTypes($exportContent)
119111
{
120112
$this->assertContains(
121113
'2.0000,8.000000,Fixed',
@@ -128,16 +120,13 @@ private function assertDiscountTypes(string $exportContent): void
128120
}
129121

130122
/**
131-
* Export multiple websites test
132-
*
133123
* @magentoAppArea adminhtml
134124
* @magentoDbIsolation disabled
135125
* @magentoAppIsolation enabled
136126
* @magentoConfigFixture current_store catalog/price/scope 1
137127
* @magentoDataFixture Magento/AdvancedPricingImportExport/_files/product_with_second_website.php
138-
* @return void
139128
*/
140-
public function testExportMultipleWebsites(): void
129+
public function testExportMultipleWebsites()
141130
{
142131
$productRepository = $this->objectManager->create(ProductRepositoryInterface::class);
143132
$index = 0;
@@ -173,18 +162,17 @@ public function testExportMultipleWebsites(): void
173162
}
174163

175164
/**
176-
* Data export
177-
*
178165
* @param string $csvFile
179166
* @return string
180167
*/
181-
private function exportData(string $csvFile): string
168+
private function exportData($csvFile)
182169
{
183170
$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+
)
188176
);
189177
$exportContent = $this->model->export();
190178
$this->assertNotEmpty($exportContent);
@@ -193,12 +181,9 @@ private function exportData(string $csvFile): string
193181
}
194182

195183
/**
196-
* Data import
197-
*
198184
* @param string $csvFile
199-
* @return void
200185
*/
201-
private function importData(string $csvFile): void
186+
private function importData($csvFile)
202187
{
203188
/** @var ImportAdvancedPricing $importModel */
204189
$importModel = $this->objectManager->create(ImportAdvancedPricing::class);
@@ -226,19 +211,8 @@ private function importData(string $csvFile): void
226211
$importModel->importData();
227212
}
228213

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+
{
242216
foreach ($expected as $key => $value) {
243217
if (in_array($key, $skippedAttributes)) {
244218
continue;

0 commit comments

Comments
 (0)