Skip to content
This repository was archived by the owner on Apr 29, 2019. It is now read-only.

Commit e79d056

Browse files
author
Sergii Kovalenko
committed
MAGETWO-87190: Test coverage for critical logic
1 parent cf7579c commit e79d056

File tree

3 files changed

+44
-0
lines changed

3 files changed

+44
-0
lines changed

dev/tests/setup-integration/framework/Magento/TestFramework/Bootstrap/SetupDocBlock.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ protected function _getSubscribers(\Magento\TestFramework\Application $applicati
3131
new \Magento\TestFramework\Annotation\ComponentRegistrarFixture($this->_fixturesBaseDir),
3232
new \Magento\TestFramework\Annotation\SchemaFixture($this->_fixturesBaseDir),
3333
new \Magento\TestFramework\Annotation\Cache(),
34+
new \Magento\TestFramework\Workaround\CacheClean(),
3435
new \Magento\TestFramework\Annotation\ReinstallInstance($application),
3536
new \Magento\TestFramework\Annotation\CopyModules(),
3637
new \Magento\TestFramework\Annotation\DataProviderFromFile()

dev/tests/setup-integration/framework/Magento/TestFramework/Deploy/CliCommand.php

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,19 @@ public function splitSales()
134134
$this->shell->execute($command, array_values($installParams));
135135
}
136136

137+
/**
138+
* Clean all types of cache
139+
*/
140+
public function cacheClean()
141+
{
142+
$initParams = $this->parametersHolder->getInitParams();
143+
$command = 'php -f ' . BP . '/bin/magento cache:clean ' .
144+
' -vvv --magento-init-params=' .
145+
$initParams['magento-init-params'];
146+
147+
$this->shell->execute($command);
148+
}
149+
137150
/**
138151
* Convert from raw params to CLI arguments, like --admin-username.
139152
*
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
<?php
2+
/**
3+
* Copyright © Magento, Inc. All rights reserved.
4+
* See COPYING.txt for license details.
5+
*/
6+
7+
namespace Magento\TestFramework\Workaround;
8+
9+
use Magento\TestFramework\Helper\Bootstrap;
10+
11+
/**
12+
* Deployment config handler.
13+
*
14+
* @package Magento\TestFramework\Workaround
15+
*/
16+
class CacheClean
17+
{
18+
/**
19+
* Start test.
20+
*
21+
* @return void
22+
*/
23+
public function startTest()
24+
{
25+
/** @var \Magento\Framework\App\Cache\Manager $cacheManager */
26+
$cacheManager = Bootstrap::getObjectManager()->get(\Magento\Framework\App\Cache\Manager::class);
27+
$types = $cacheManager->getAvailableTypes();
28+
$cacheManager->clean($types);
29+
}
30+
}

0 commit comments

Comments
 (0)