Skip to content

Commit 0636355

Browse files
committed
MC-21718: Storefront Category URL management
1 parent 5f1c0ee commit 0636355

File tree

1 file changed

+4
-19
lines changed

1 file changed

+4
-19
lines changed

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

Lines changed: 4 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -7,29 +7,14 @@
77

88
namespace Magento\UrlRewrite\Controller;
99

10-
use Magento\Catalog\Api\CategoryRepositoryInterface;
1110
use Magento\TestFramework\TestCase\AbstractController;
1211
use Magento\Framework\App\Response\Http as HttpResponse;
13-
use Zend\Http\Response;
1412

1513
/**
1614
* Class to test Match corresponding URL Rewrite
1715
*/
1816
class UrlRewriteTest extends AbstractController
1917
{
20-
/** @var CategoryRepositoryInterface */
21-
private $categoryRepository;
22-
23-
/**
24-
* @inheritdoc
25-
*/
26-
protected function setUp()
27-
{
28-
parent::setUp();
29-
30-
$this->categoryRepository = $this->_objectManager->get(CategoryRepositoryInterface::class);
31-
}
32-
3318
/**
3419
* @magentoDataFixture Magento/UrlRewrite/_files/url_rewrite.php
3520
* @magentoDbIsolation disabled
@@ -47,15 +32,15 @@ protected function setUp()
4732
public function testMatchUrlRewrite(
4833
string $request,
4934
string $redirect,
50-
int $expectedCode = Response::STATUS_CODE_301
35+
int $expectedCode = HttpResponse::STATUS_CODE_301
5136
): void {
5237
$this->dispatch($request);
5338
/** @var HttpResponse $response */
5439
$response = $this->getResponse();
5540
$code = $response->getHttpResponseCode();
5641
$this->assertEquals($expectedCode, $code, 'Invalid response code');
5742

58-
if ($expectedCode !== Response::STATUS_CODE_200) {
43+
if ($expectedCode !== HttpResponse::STATUS_CODE_200) {
5944
$location = $response->getHeader('Location')->getFieldValue();
6045
$this->assertStringEndsWith(
6146
$redirect,
@@ -98,7 +83,7 @@ public function requestDataProvider(): array
9883
'Use Case #7: Request with query params' => [
9984
'request' => '/enable-cookies/?test-param',
10085
'redirect' => '',
101-
Response::STATUS_CODE_200,
86+
HttpResponse::STATUS_CODE_200,
10287
],
10388
];
10489
}
@@ -116,7 +101,7 @@ public function testCategoryUrlRewrite(string $request): void
116101
$this->dispatch($request);
117102
$response = $this->getResponse();
118103
$this->assertEquals(
119-
Response::STATUS_CODE_200,
104+
HttpResponse::STATUS_CODE_200,
120105
$response->getHttpResponseCode(),
121106
'Response code does not match expected value'
122107
);

0 commit comments

Comments
 (0)