Skip to content

Commit f430b56

Browse files
committed
MAGETWO-32645: Fix L* builds failures
- Fix integration test failures - Add changes to reset base url for integration test suite after \Magento\Backend\Controller\Adminhtml\System\ConfigTest
1 parent 5383dcd commit f430b56

File tree

1 file changed

+29
-1
lines changed
  • dev/tests/integration/testsuite/Magento/Backend/Controller/Adminhtml/System

1 file changed

+29
-1
lines changed

dev/tests/integration/testsuite/Magento/Backend/Controller/Adminhtml/System/ConfigTest.php

Lines changed: 29 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55
*/
66
namespace Magento\Backend\Controller\Adminhtml\System;
77

8+
use Magento\TestFramework\Helper\Bootstrap;
9+
810
/**
911
* @magentoAppArea adminhtml
1012
*/
@@ -22,6 +24,7 @@ public function testEditAction()
2224
*/
2325
public function testChangeBaseUrl()
2426
{
27+
$defaultHost = Bootstrap::getObjectManager()->create('Magento\Framework\Url')->getBaseUrl();
2528
$newHost = 'm2test123.loc';
2629
$request = $this->getRequest();
2730
$request->setPost(
@@ -52,6 +55,31 @@ public function testChangeBaseUrl()
5255
'No GET params, including "SID", were expected, but somewhat exists'
5356
);
5457
$this->assertEquals($newHost, $url['host'], 'A new host in the url expected, but there is old one');
58+
$this->resetBaseUrl($defaultHost);
5559
}
56-
}
5760

61+
/**
62+
* Reset test framework default base url
63+
*/
64+
protected function resetBaseUrl($defaultHost)
65+
{
66+
$baseUrlData = [
67+
'section' => 'web',
68+
'website' => NULL,
69+
'store' => NULL,
70+
'groups' => [
71+
'unsecure' => [
72+
'fields' => [
73+
'base_url' => [
74+
'value' => $defaultHost
75+
]
76+
]
77+
]
78+
]
79+
];
80+
Bootstrap::getObjectManager()->create('Magento\Backend\Model\Config\Factory')
81+
->create()
82+
->addData($baseUrlData)
83+
->save();
84+
}
85+
}

0 commit comments

Comments
 (0)