Skip to content

Commit 6c2d937

Browse files
author
silinmykola
committed
fixes after code review
1 parent fc8573e commit 6c2d937

File tree

7 files changed

+21
-30
lines changed

7 files changed

+21
-30
lines changed

app/code/Magento/Catalog/Test/Unit/Model/Category/FileInfoTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ function ($arg) use ($baseDirectory, $pubDirectory) {
117117
->willReturn('/a/b/c/pub/');
118118

119119
$this->store->method('getBaseUrl')
120-
->willReturn('');
120+
->willReturn('https://example.com/');
121121

122122
$this->model = new FileInfo(
123123
$this->filesystem,

app/code/Magento/Customer/Test/Unit/Model/Metadata/Form/FileTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
*/
2828
class FileTest extends AbstractFormTestCase
2929
{
30-
const ENTITY_TYPE = 0;
30+
public const ENTITY_TYPE = 0;
3131

3232
/**
3333
* @var MockObject|EncoderInterface

app/code/Magento/Customer/Test/Unit/Model/Metadata/Form/MultiselectTest.php

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -195,27 +195,21 @@ protected function runOutputValueTest($value, $expected, $format)
195195
->disableOriginalConstructor()
196196
->setMethods(['getLabel', 'getValue'])
197197
->getMockForAbstractClass();
198-
$option1->expects($this->any())
199-
->method('getLabel')
198+
$option1->method('getLabel')
200199
->willReturn('fourteen');
201-
$option1->expects($this->any())
202-
->method('getValue')
200+
$option1->method('getValue')
203201
->willReturn('14');
204202

205203
$option2 = $this->getMockBuilder(OptionInterface::class)
206204
->disableOriginalConstructor()
207205
->setMethods(['getLabel', 'getValue'])
208206
->getMockForAbstractClass();
209-
$option2->expects($this->any())
210-
->method('getLabel')
207+
$option2->method('getLabel')
211208
->willReturn('some string');
212-
$option2->expects($this->any())
213-
->method('getValue')
209+
$option2->method('getValue')
214210
->willReturn('some key');
215211

216-
$this->attributeMetadataMock->expects(
217-
$this->any()
218-
)->method(
212+
$this->attributeMetadataMock->method(
219213
'getOptions'
220214
)->willReturn(
221215
[

app/code/Magento/MediaStorage/Test/Unit/App/MediaTest.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,9 @@
3737
*/
3838
class MediaTest extends TestCase
3939
{
40-
const MEDIA_DIRECTORY = 'mediaDirectory';
41-
const RELATIVE_FILE_PATH = 'test/file.png';
42-
const CACHE_FILE_PATH = 'var';
40+
public const MEDIA_DIRECTORY = 'mediaDirectory';
41+
public const RELATIVE_FILE_PATH = 'test/file.png';
42+
public const CACHE_FILE_PATH = 'var';
4343

4444
/**
4545
* @var Media

lib/internal/Magento/Framework/Code/Test/Unit/Generator/EntityAbstractTest.php

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -15,28 +15,25 @@
1515

1616
class EntityAbstractTest extends TestCase
1717
{
18-
/**#@+
18+
/**
1919
* Source and result class parameters
2020
*/
21-
const RESULT_FILE = 'MyResult/MyResult.php';
22-
23-
const RESULT_DIRECTORY = 'MyResult';
21+
public const RESULT_FILE = 'MyResult/MyResult.php';
2422

25-
/**#@-*/
23+
public const RESULT_DIRECTORY = 'MyResult';
2624

2725
/**
2826
* Basic code generation directory
2927
*/
30-
const GENERATION_DIRECTORY = 'generation';
28+
public const GENERATION_DIRECTORY = 'generation';
3129

32-
/**#@+
30+
/**
3331
* Generated code before and after code style fix
3432
*/
35-
const SOURCE_CODE = "a = 1; b = array (); {\n\n some source code \n\n}";
33+
public const SOURCE_CODE = "a = 1; b = array (); {\n\n some source code \n\n}";
3634

37-
const RESULT_CODE = "a = 1; b = array(); {\n some generated php code \n}";
35+
public const RESULT_CODE = "a = 1; b = array(); {\n some generated php code \n}";
3836

39-
/**#@-*/
4037
/**
4138
* Model under test
4239
*

lib/internal/Magento/Framework/View/Test/Unit/Asset/Bundle/ManagerTest.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -120,11 +120,11 @@ public function testAddAssetWithExcludedFile()
120120
->willReturn('source/file.min.js');
121121
$this->asset->expects($this->once())
122122
->method('getPath')
123-
->willReturn('');
123+
->willReturn('some/path/to_file');
124124
$dirRead->expects($this->once())
125125
->method('getAbsolutePath')
126-
->with('')
127-
->willReturn(true);
126+
->with('some/path/to_file')
127+
->willReturn('some/path/to_file');
128128
$this->filesystem->expects($this->once())
129129
->method('getDirectoryRead')
130130
->with(DirectoryList::APP)

lib/internal/Magento/Framework/View/Test/Unit/Element/Html/Link/CurrentTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ public function testIsCurrentIfIsset(): void
8282
$this->_urlBuilderMock
8383
->method('getUrl')
8484
->with($pathStub)
85-
->will($this->returnValue(''));
85+
->will($this->returnValue('http://example.com/'));
8686
$this->currentLink->setPath($pathStub);
8787
$this->currentLink->setCurrent(true);
8888
$this->assertTrue($this->currentLink->isCurrent());

0 commit comments

Comments
 (0)