Skip to content

Commit

Permalink
ESDEV-4156 Update tearDown
Browse files Browse the repository at this point in the history
We must ensure that the environment for the next test run is
fully prepared as next test in queue might not be able to
restore the original database.
  • Loading branch information
rezonanc-oxid committed Jan 9, 2017
1 parent 840f500 commit e25540f
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions tests/Acceptance/Frontend/ShopSetUpTest.php
Expand Up @@ -26,6 +26,7 @@
use oxConnectionException;
use OxidEsales\EshopCommunity\Tests\Acceptance\FrontendTestCase;
use OxidEsales\TestingLibrary\ServiceCaller;
use OxidEsales\TestingLibrary\TestConfig;
use oxRegistry;

/** Selenium tests for frontend navigation. */
Expand All @@ -34,11 +35,9 @@ class ShopSetUpTest extends FrontendTestCase
/** @var int How much more time wait for these tests. */
protected $_iWaitTimeMultiplier = 7;

/**
* Regenerate views after test.
*/
protected function tearDown()
{
$this->resetShop();
parent::tearDown();

$oServiceCaller = new ServiceCaller($this->getTestConfig());
Expand Down Expand Up @@ -274,4 +273,15 @@ protected function isPackage()
{
return file_exists($this->getTestConfig()->getShopPath() . '/pkg.info');
}

private function resetShop()
{
$testConfig = new TestConfig();
$serviceCaller = new ServiceCaller($testConfig);
$serviceCaller->setParameter('serial', $testConfig->getShopSerial());
$serviceCaller->setParameter('addDemoData', 1);
$serviceCaller->setParameter('turnOnVarnish', $testConfig->shouldEnableVarnish());
$serviceCaller->setParameter('setupPath', $testConfig->getShopSetupPath());
$serviceCaller->callService('ShopInstaller');
}
}

0 comments on commit e25540f

Please sign in to comment.