Skip to content

Commit 0ed3bbb

Browse files
committed
MC-20322: [Forwardport] Disable statistic collecting for Reports module
1 parent 79b0f9c commit 0ed3bbb

File tree

1 file changed

+22
-5
lines changed

1 file changed

+22
-5
lines changed

dev/tests/functional/tests/app/Magento/Sales/Test/TestCase/MoveRecentlyComparedProductsOnOrderPageTest.php

Lines changed: 22 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,13 @@
88

99
use Magento\Catalog\Test\Page\Product\CatalogProductCompare;
1010
use Magento\Catalog\Test\Page\Product\CatalogProductView;
11+
use Magento\Catalog\Test\TestStep\CreateProductsStep;
1112
use Magento\Cms\Test\Page\CmsIndex;
1213
use Magento\Customer\Test\Fixture\Customer;
1314
use Magento\Customer\Test\Page\Adminhtml\CustomerIndex;
1415
use Magento\Customer\Test\Page\Adminhtml\CustomerIndexEdit;
16+
use Magento\Customer\Test\TestStep\LoginCustomerOnFrontendStep;
17+
use Magento\Mtf\Util\Command\Cli\Config;
1518
use Magento\Sales\Test\Page\Adminhtml\OrderCreateIndex;
1619
use Magento\Mtf\Client\BrowserInterface;
1720
use Magento\Mtf\TestCase\Injectable;
@@ -91,22 +94,30 @@ class MoveRecentlyComparedProductsOnOrderPageTest extends Injectable
9194
*/
9295
protected $catalogProductCompare;
9396

97+
/**
98+
* @var Config
99+
*/
100+
private $config;
101+
94102
/**
95103
* Create customer.
96-
*
97104
* @param Customer $customer
98105
* @param BrowserInterface $browser
106+
* @param Config $config
99107
* @return array
100108
*/
101-
public function __prepare(Customer $customer, BrowserInterface $browser)
109+
public function __prepare(Customer $customer, BrowserInterface $browser, Config $config)
102110
{
103111
$customer->persist();
104112
// Login under customer
105113
$this->objectManager
106-
->create(\Magento\Customer\Test\TestStep\LoginCustomerOnFrontendStep::class, ['customer' => $customer])
114+
->create(LoginCustomerOnFrontendStep::class, ['customer' => $customer])
107115
->run();
108116
$this->browser = $browser;
109117

118+
$this->config = $config;
119+
$this->config->setConfig('reports/options/enabled', 1);
120+
110121
return ['customer' => $customer];
111122
}
112123

@@ -139,18 +150,18 @@ public function __inject(
139150

140151
/**
141152
* Move recently compared products on order page.
142-
*
143153
* @param Customer $customer
144154
* @param string $products
145155
* @param bool $productsIsConfigured
146156
* @return array
157+
* @throws \Exception
147158
*/
148159
public function test(Customer $customer, $products, $productsIsConfigured = false)
149160
{
150161
// Preconditions
151162
// Create product
152163
$products = $this->objectManager->create(
153-
\Magento\Catalog\Test\TestStep\CreateProductsStep::class,
164+
CreateProductsStep::class,
154165
['products' => $products]
155166
)->run()['products'];
156167
foreach ($products as $itemProduct) {
@@ -171,4 +182,10 @@ public function test(Customer $customer, $products, $productsIsConfigured = fals
171182

172183
return ['products' => $products, 'productsIsConfigured' => $productsIsConfigured];
173184
}
185+
186+
public function tearDown()
187+
{
188+
$this->config->setConfig('reports/options/enabled', 0);
189+
parent::tearDown();
190+
}
174191
}

0 commit comments

Comments
 (0)