Skip to content

Commit 2cf996c

Browse files
committed
MC-21718: Storefront Category URL management
1 parent 25dc71f commit 2cf996c

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

dev/tests/integration/testsuite/Magento/UrlRewrite/Controller/UrlRewriteTest.php

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
* Copyright © Magento, Inc. All rights reserved.
44
* See COPYING.txt for license details.
55
*/
6+
declare(strict_types=1);
7+
68
namespace Magento\UrlRewrite\Controller;
79

810
use Magento\Catalog\Api\CategoryRepositoryInterface;
@@ -38,21 +40,22 @@ protected function setUp()
3840
* @param string $request
3941
* @param string $redirect
4042
* @param int $expectedCode
43+
* @return void
4144
*
4245
* @dataProvider requestDataProvider
4346
*/
4447
public function testMatchUrlRewrite(
4548
string $request,
4649
string $redirect,
4750
int $expectedCode = 301
48-
) {
51+
): void {
4952
$this->dispatch($request);
5053
/** @var HttpResponse $response */
5154
$response = $this->getResponse();
5255
$code = $response->getHttpResponseCode();
5356
$this->assertEquals($expectedCode, $code, 'Invalid response code');
5457

55-
if ($expectedCode !== 200) {
58+
if ($expectedCode !== Response::STATUS_CODE_200) {
5659
$location = $response->getHeader('Location')->getFieldValue();
5760
$this->assertStringEndsWith(
5861
$redirect,
@@ -65,7 +68,7 @@ public function testMatchUrlRewrite(
6568
/**
6669
* @return array
6770
*/
68-
public function requestDataProvider()
71+
public function requestDataProvider(): array
6972
{
7073
return [
7174
'Use Case #1: Rewrite: page-one/ --(301)--> page-a/; Request: page-one/ --(301)--> page-a/' => [
@@ -95,7 +98,7 @@ public function requestDataProvider()
9598
'Use Case #7: Request with query params' => [
9699
'request' => '/enable-cookies/?test-param',
97100
'redirect' => '',
98-
200,
101+
Response::STATUS_CODE_200,
99102
],
100103
];
101104
}

0 commit comments

Comments
 (0)