Skip to content

Commit e7b3597

Browse files
committed
39672: Fixed Review Comments
1 parent d7c3b5b commit e7b3597

File tree

1 file changed

+18
-16
lines changed

1 file changed

+18
-16
lines changed

app/code/Magento/Csp/Test/Unit/Model/Collector/CspWhitelistXml/FileResolverTest.php

Lines changed: 18 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -71,16 +71,15 @@ protected function setUp(): void
7171
{
7272
$this->moduleFileResolverMock = $this->getMockBuilder(FileResolverInterface::class)
7373
->disableOriginalConstructor()
74-
->onlyMethods(['get'])
75-
->getMockForAbstractClass();
74+
->getMock();
7675

7776
$this->designMock = $this->getMockBuilder(DesignInterface::class)
7877
->disableOriginalConstructor()
79-
->onlyMethods(['getDesignTheme'])
80-
->getMockForAbstractClass();
78+
->getMock();
8179

8280
$this->themeInterFaceMock = $this->getMockBuilder(ThemeInterface::class)
83-
->getMockForAbstractClass();
81+
->disableOriginalConstructor()
82+
->getMock();
8483

8584
$this->designMock->expects($this->once())
8685
->method('getDesignTheme')
@@ -93,13 +92,13 @@ protected function setUp(): void
9392

9493
$this->customizationInterfaceMock = $this->getMockBuilder(CustomizationInterface::class)
9594
->disableOriginalConstructor()
96-
->getMockForAbstractClass();
95+
->getMock();
9796

9897
$this->filesystemMock = $this->createPartialMock(Filesystem::class, ['getDirectoryRead']);
9998

10099
$this->readInterfaceMock = $this->getMockBuilder(ReadInterface::class)
101-
->disableOriginalConstructor()
102-
->getMockForAbstractClass();
100+
->disableOriginalConstructor()
101+
->getMock();
103102

104103
$this->filesystemMock->expects($this->once())
105104
->method('getDirectoryRead')
@@ -122,17 +121,19 @@ protected function setUp(): void
122121
/**
123122
* Test for get method with frontend scope.
124123
*
125-
* @param string $filename
124+
* @param string $scope
125+
* @param string $fileName
126126
* @param array $fileList
127+
* @param string $themeFilesPath
127128
*
128129
* @return void
129130
* @dataProvider providerGetFrontend
130131
*/
131-
public function testGetFrontend(string $scope, string $filename, array $fileList, string $themeFilesPath): void
132+
public function testGetFrontend(string $scope, string $fileName, array $fileList, string $themeFilesPath): void
132133
{
133134
$this->moduleFileResolverMock->expects($this->once())
134135
->method('get')
135-
->with($filename, $scope)
136+
->with($fileName, $scope)
136137
->willReturn($fileList);
137138

138139
$this->customizationFactoryMock->expects($this->any())
@@ -146,26 +147,27 @@ public function testGetFrontend(string $scope, string $filename, array $fileList
146147

147148
$this->readInterfaceMock->expects($this->once())
148149
->method('isExist')
149-
->with($themeFilesPath.'/etc/'.$filename)
150+
->with($themeFilesPath.'/etc/'.$fileName)
150151
->willReturn(true);
151152

152153
$this->iteratorFactoryMock->expects($this->once())
153154
->method('create')
154155
->with(
155156
[
156-
'paths' => array_reverse([$themeFilesPath.'/etc/'.$filename]),
157+
'paths' => array_reverse([$themeFilesPath.'/etc/'.$fileName]),
157158
'existingIterator' => $fileList
158159
]
159160
)
160161
->willReturn($fileList);
161162

162-
$this->assertEquals($fileList, $this->model->get($filename, $scope));
163+
$this->assertEquals($fileList, $this->model->get($fileName, $scope));
163164
}
164165

165166
/**
166167
* Test for get method with global scope.
167168
*
168-
* @param string $filename
169+
* @param string $scope
170+
* @param string $fileName
169171
* @param array $fileList
170172
*
171173
* @return void
@@ -181,7 +183,7 @@ public function testGetGlobal(string $scope, string $fileName, array $fileList):
181183
}
182184

183185
/**
184-
* Data provider for get glocal scope tests.
186+
* Data provider for get global scope tests.
185187
*
186188
* @return array
187189
*/

0 commit comments

Comments
 (0)