Skip to content

Commit 4647684

Browse files
committed
PRs improvements
1 parent 39c9918 commit 4647684

File tree

6 files changed

+20
-16
lines changed

6 files changed

+20
-16
lines changed

dev/tests/integration/testsuite/Magento/Customer/Model/SessionTest.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ class SessionTest extends \PHPUnit\Framework\TestCase
2121
/**
2222
* Session ID in query param
2323
*/
24-
const SESSION_ID_QUERY_PARAM = 'SID';
24+
private const SESSION_ID_QUERY_PARAM = 'SID';
2525

2626
/**
2727
* @var \Magento\Customer\Model\Session

dev/tests/integration/testsuite/Magento/Framework/View/Element/AbstractBlockTest.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ class AbstractBlockTest extends \PHPUnit\Framework\TestCase
1818
/**
1919
* Session ID in query param
2020
*/
21-
const SESSION_ID_QUERY_PARAM = 'SID';
21+
private const SESSION_ID_QUERY_PARAM = 'SID';
2222

2323
/**
2424
* @var AbstractBlock

dev/tests/integration/testsuite/Magento/Store/Controller/Store/RedirectTest.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ class RedirectTest extends AbstractController
2525
/**
2626
* Session ID in query param
2727
*/
28-
const SESSION_ID_QUERY_PARAM = 'SID';
28+
private const SESSION_ID_QUERY_PARAM = 'SID';
2929

3030
/**
3131
* @var RedirectDataPreprocessorInterface

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

+8-8
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,9 @@
2222
class StoreTest extends \PHPUnit\Framework\TestCase
2323
{
2424
/**
25-
* Session ID in query param
25+
* Test ID in query param
2626
*/
27-
const SESSION_ID_QUERY_PARAM = 'SID';
27+
private const TEST_ID_QUERY_PARAM = 'TID';
2828

2929
/**
3030
* @var array
@@ -308,11 +308,11 @@ public function testGetCurrentUrl()
308308

309309
$this->model
310310
->expects($this->any())->method('getUrl')
311-
->willReturn('http://localhost/index.php?' . self::SESSION_ID_QUERY_PARAM . '=12345');
312-
$this->request->setParams([self::SESSION_ID_QUERY_PARAM, '12345']);
313-
$this->request->setQueryValue(self::SESSION_ID_QUERY_PARAM, '12345');
311+
->willReturn('http://localhost/index.php?' . self::TEST_ID_QUERY_PARAM . '=12345');
312+
$this->request->setParams([self::TEST_ID_QUERY_PARAM, '12345']);
313+
$this->request->setQueryValue(self::TEST_ID_QUERY_PARAM, '12345');
314314
$this->assertStringContainsString(
315-
self::SESSION_ID_QUERY_PARAM . '=12345',
315+
self::TEST_ID_QUERY_PARAM . '=12345',
316316
$this->model->getCurrentUrl()
317317
);
318318

@@ -330,11 +330,11 @@ public function testGetCurrentUrl()
330330
$url
331331
);
332332
$this->assertEquals(
333-
$secondStore->getBaseUrl() . '?SID=12345&___from_store=default',
333+
$secondStore->getBaseUrl() . '?' . self::TEST_ID_QUERY_PARAM . '=12345&___from_store=default',
334334
$secondStore->getCurrentUrl()
335335
);
336336
$this->assertEquals(
337-
$secondStore->getBaseUrl() . '?SID=12345',
337+
$secondStore->getBaseUrl() . '?' . self::TEST_ID_QUERY_PARAM . '=12345',
338338
$secondStore->getCurrentUrl(false)
339339
);
340340
}

lib/internal/Magento/Framework/View/Element/UiComponentFactory.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -31,12 +31,12 @@ class UiComponentFactory extends DataObject
3131
/**
3232
* The key arguments in the data component
3333
*/
34-
const COMPONENT_ARGUMENTS_KEY = 'arguments';
34+
private const COMPONENT_ARGUMENTS_KEY = 'arguments';
3535

3636
/**
3737
* The key attributes in the data component
3838
*/
39-
const COMPONENT_ATTRIBUTES_KEY = 'attributes';
39+
private const COMPONENT_ATTRIBUTES_KEY = 'attributes';
4040

4141
/**
4242
* Object manager

lib/internal/Magento/Framework/View/Test/Unit/UiComponent/Factory/HtmlContentFactoryTest.php

+7-3
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,17 @@
1010
use Magento\Framework\View\Element\AbstractBlock;
1111
use Magento\Framework\View\Element\UiComponent\ContextInterface;
1212
use Magento\Framework\View\Element\UiComponent\Factory\HtmlContentFactory;
13-
use Magento\Framework\View\Element\UiComponentFactory;
1413
use Magento\Framework\View\Layout;
1514
use PHPUnit\Framework\MockObject\MockObject;
1615
use PHPUnit\Framework\TestCase;
1716

1817
class HtmlContentFactoryTest extends TestCase
1918
{
19+
/**
20+
* The key arguments in the data component
21+
*/
22+
private const COMPONENT_ARGUMENTS_KEY = 'arguments';
23+
2024
/**
2125
* @var Layout|MockObject
2226
*/
@@ -55,7 +59,7 @@ protected function setUp(): void
5559
public function testCreate()
5660
{
5761
$blockName = 'blockName';
58-
$bundleComponents[UiComponentFactory::COMPONENT_ARGUMENTS_KEY]['block']['name'] = $blockName;
62+
$bundleComponents[self::COMPONENT_ARGUMENTS_KEY]['block']['name'] = $blockName;
5963
$this->layout->expects($this->once())
6064
->method('getBlock')
6165
->with($blockName)
@@ -71,6 +75,6 @@ public function testCreate()
7175
]
7276
)
7377
);
74-
$this->assertEquals($this->block, $bundleComponents[UiComponentFactory::COMPONENT_ARGUMENTS_KEY]['block']);
78+
$this->assertEquals($this->block, $bundleComponents[self::COMPONENT_ARGUMENTS_KEY]['block']);
7579
}
7680
}

0 commit comments

Comments
 (0)