Skip to content

Commit c8981ee

Browse files
ShradddhaShradddha
authored andcommitted
fixed getMockClass is remove in PHPUnit10
1 parent 79e1e74 commit c8981ee

File tree

3 files changed

+44
-15
lines changed

3 files changed

+44
-15
lines changed

lib/internal/Magento/Framework/App/Test/Unit/Router/ActionListTest.php

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -133,13 +133,18 @@ public function testGet($module, $area, $namespace, $action, $data, $isInstantia
133133
public function getDataProvider()
134134
{
135135
$mockClassName = 'Mock_Action_Class';
136-
$actionClass = $this->getMockClass(
136+
$actionClassObject = $this->getMockForAbstractClass(
137137
ActionInterface::class,
138-
['execute', 'getResponse'],
139138
[],
140-
$mockClassName
139+
$mockClassName,
140+
true,
141+
true,
142+
true,
143+
['execute', 'getResponse']
141144
);
142145

146+
$actionClass = get_class($actionClassObject);
147+
143148
return [
144149
[
145150
'Magento_Module',

lib/internal/Magento/Framework/Profiler/Test/Unit/Driver/FactoryTest.php

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -70,18 +70,30 @@ public function testCreate($config, $expectedClass)
7070
*/
7171
public function createDataProvider()
7272
{
73-
$defaultDriverClass = $this->getMockClass(
73+
$defaultDriverClassMock = $this->getMockForAbstractClass(
7474
DriverInterface::class,
7575
[],
76-
[],
77-
'Magento_Framework_Profiler_Driver_Test_Default'
76+
'Magento_Framework_Profiler_Driver_Test_Default',
77+
true,
78+
true,
79+
true,
80+
[]
7881
);
79-
$testDriverClass = $this->getMockClass(
82+
83+
$defaultDriverClass = get_class($defaultDriverClassMock);
84+
85+
$testDriverClassMock = $this->getMockForAbstractClass(
8086
DriverInterface::class,
8187
[],
82-
[],
83-
'Magento_Framework_Profiler_Driver_Test_Test'
88+
'Magento_Framework_Profiler_Driver_Test_Test',
89+
true,
90+
true,
91+
true,
92+
[]
8493
);
94+
95+
$testDriverClass = get_class($testDriverClassMock);
96+
8597
return [
8698
'Prefix and concrete type' => [['type' => 'test'], $testDriverClass],
8799
'Prefix and default type' => [[], $defaultDriverClass],

lib/internal/Magento/Framework/Profiler/Test/Unit/Driver/Standard/Output/FactoryTest.php

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -70,18 +70,30 @@ public function testCreate($configData, $expectedClass)
7070
*/
7171
public function createDataProvider()
7272
{
73-
$defaultOutputClass = $this->getMockClass(
73+
$defaultOutputClassMock = $this->getMockForAbstractClass(
7474
OutputInterface::class,
7575
[],
76-
[],
77-
'Magento_Framework_Profiler_Driver_Standard_Output_Test_Default'
76+
'Magento_Framework_Profiler_Driver_Standard_Output_Test_Default',
77+
true,
78+
true,
79+
true,
80+
[]
7881
);
79-
$testOutputClass = $this->getMockClass(
82+
83+
$defaultOutputClass = get_class($defaultOutputClassMock);
84+
85+
$testOutputClassMock = $this->getMockForAbstractClass(
8086
OutputInterface::class,
8187
[],
82-
[],
83-
'Magento_Framework_Profiler_Driver_Standard_Output_Test_Test'
88+
'Magento_Framework_Profiler_Driver_Standard_Output_Test_Test',
89+
true,
90+
true,
91+
true,
92+
[]
8493
);
94+
95+
$testOutputClass = get_class($testOutputClassMock);
96+
8597
return [
8698
'Prefix and concrete type' => [['type' => 'test'], $testOutputClass],
8799
'Prefix and default type' => [[], $defaultOutputClass],

0 commit comments

Comments
 (0)