Skip to content

Commit 977a18a

Browse files
committed
#20968: Integration tests fix.
1 parent 316133a commit 977a18a

File tree

2 files changed

+13
-10
lines changed

2 files changed

+13
-10
lines changed

dev/tests/integration/testsuite/Magento/Store/App/FrontController/Plugin/RequestPreprocessorTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ public function testHttpsPassSecureLoginPost()
5656
$this->prepareRequest(true);
5757
$this->dispatch('customer/account/loginPost/');
5858
$redirectUrl = str_replace('http://', 'https://', $this->baseUrl) .
59-
'index.php/customer/account/';
59+
'customer/account/';
6060
$this->assertResponseRedirect($this->getResponse(), $redirectUrl);
6161
$this->assertTrue($this->_objectManager->get(Session::class)->isLoggedIn());
6262
$this->setFrontendCompletelySecureRollback();

dev/tests/integration/testsuite/Magento/Store/Model/StoreTest.php

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88

99
use Magento\Catalog\Model\ProductRepository;
1010
use Magento\Framework\App\Bootstrap;
11-
use Magento\Framework\App\Config\ScopeConfigInterface;
1211
use Magento\Framework\App\Filesystem\DirectoryList;
1312
use Magento\Framework\UrlInterface;
1413
use Magento\Store\Api\StoreRepositoryInterface;
@@ -201,7 +200,7 @@ public function testGetBaseUrlInPub()
201200
*/
202201
public function testGetBaseUrlForCustomEntryPoint($type, $useCustomEntryPoint, $useStoreCode, $expected)
203202
{
204-
/* config operations require store to be loaded */
203+
/* config operations require store to be loaded */
205204
$this->model->load('default');
206205
\Magento\TestFramework\Helper\Bootstrap::getObjectManager()
207206
->get(\Magento\Framework\App\Config\MutableScopeConfigInterface::class)
@@ -213,6 +212,10 @@ public function testGetBaseUrlForCustomEntryPoint($type, $useCustomEntryPoint, $
213212

214213
// emulate custom entry point
215214
$_SERVER['SCRIPT_FILENAME'] = 'custom_entry.php';
215+
$request = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()
216+
->get(\Magento\Framework\App\RequestInterface::class);
217+
$request->setServer(new Parameters($_SERVER));
218+
216219
if ($useCustomEntryPoint) {
217220
$property = new \ReflectionProperty($this->model, '_isCustomEntryPoint');
218221
$property->setAccessible(true);
@@ -298,11 +301,11 @@ public function testGetCurrentUrl()
298301
$url = $product->getUrlInStore();
299302

300303
$this->assertEquals(
301-
$secondStore->getBaseUrl().'catalog/product/view/id/1/s/simple-product/',
304+
$secondStore->getBaseUrl() . 'catalog/product/view/id/1/s/simple-product/',
302305
$url
303306
);
304307
$this->assertEquals(
305-
$secondStore->getBaseUrl().'?___from_store=default',
308+
$secondStore->getBaseUrl() . '?___from_store=default',
306309
$secondStore->getCurrentUrl()
307310
);
308311
$this->assertEquals(
@@ -332,25 +335,25 @@ public function testGetCurrentUrlWithUseStoreInUrlFalse()
332335
$product->setStoreId($secondStore->getId());
333336
$url = $product->getUrlInStore();
334337

335-
/** @var \Magento\Catalog\Model\CategoryRepository $categoryRepository */
338+
/** @var \Magento\Catalog\Model\CategoryRepository $categoryRepository */
336339
$categoryRepository = $objectManager->get(\Magento\Catalog\Model\CategoryRepository::class);
337340
$category = $categoryRepository->get(333, $secondStore->getStoreId());
338341

339342
$this->assertEquals(
340-
$secondStore->getBaseUrl().'catalog/category/view/s/category-1/id/333/',
343+
$secondStore->getBaseUrl() . 'catalog/category/view/s/category-1/id/333/',
341344
$category->getUrl()
342345
);
343346
$this->assertEquals(
344-
$secondStore->getBaseUrl().
347+
$secondStore->getBaseUrl() .
345348
'catalog/product/view/id/333/s/simple-product-three/?___store=fixture_second_store',
346349
$url
347350
);
348351
$this->assertEquals(
349-
$secondStore->getBaseUrl().'?___store=fixture_second_store&___from_store=default',
352+
$secondStore->getBaseUrl() . '?___store=fixture_second_store&___from_store=default',
350353
$secondStore->getCurrentUrl()
351354
);
352355
$this->assertEquals(
353-
$secondStore->getBaseUrl().'?___store=fixture_second_store',
356+
$secondStore->getBaseUrl() . '?___store=fixture_second_store',
354357
$secondStore->getCurrentUrl(false)
355358
);
356359
}

0 commit comments

Comments
 (0)