Skip to content
This repository was archived by the owner on Apr 29, 2019. It is now read-only.

Commit ee81f67

Browse files
committed
Fix PHPUnit 7 class removals for InvokedCount and ReturnStub
- Replace \PHPUnit_Framework_MockObject_Matcher_InvokedCount - Replace \PHPUnit_Framework_MockObject_Stub_Return
1 parent dbe3b6e commit ee81f67

File tree

16 files changed

+46
-46
lines changed

16 files changed

+46
-46
lines changed

Diff for: app/code/Magento/Analytics/Test/Unit/ReportXml/DB/ReportValidatorTest.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -79,9 +79,9 @@ protected function setUp()
7979
* @dataProvider errorDataProvider
8080
* @param string $reportName
8181
* @param array $result
82-
* @param \PHPUnit_Framework_MockObject_Stub $queryReturnStub
82+
* @param \PHPUnit\Framework\MockObject\Stub $queryReturnStub
8383
*/
84-
public function testValidate($reportName, $result, \PHPUnit_Framework_MockObject_Stub $queryReturnStub)
84+
public function testValidate($reportName, $result, \PHPUnit\Framework\MockObject\Stub $queryReturnStub)
8585
{
8686
$connectionName = 'testConnection';
8787
$this->queryFactoryMock->expects($this->once())

Diff for: app/code/Magento/Config/Test/Unit/Console/Command/ConfigShow/ValueProcessorTest.php

+9-9
Original file line numberDiff line numberDiff line change
@@ -73,15 +73,15 @@ protected function setUp()
7373

7474
/**
7575
* @param bool $hasBackendModel
76-
* @param \PHPUnit_Framework_MockObject_Matcher_InvokedCount $expectsGetBackendModel
77-
* @param \PHPUnit_Framework_MockObject_Matcher_InvokedCount $expectsCreate
78-
* @param \PHPUnit_Framework_MockObject_Matcher_InvokedCount $expectsGetValue
79-
* @param \PHPUnit_Framework_MockObject_Matcher_InvokedCount $expectsSetPath
80-
* @param \PHPUnit_Framework_MockObject_Matcher_InvokedCount $expectsSetScope
81-
* @param \PHPUnit_Framework_MockObject_Matcher_InvokedCount $expectsSetScopeId
82-
* @param \PHPUnit_Framework_MockObject_Matcher_InvokedCount $expectsSetValue
83-
* @param \PHPUnit_Framework_MockObject_Matcher_InvokedCount $expectsAfterLoad
84-
* @param \PHPUnit_Framework_MockObject_Matcher_InvokedCount $expectsSerialize
76+
* @param \PHPUnit\Framework\MockObject\Matcher\InvokedCount $expectsGetBackendModel
77+
* @param \PHPUnit\Framework\MockObject\Matcher\InvokedCount $expectsCreate
78+
* @param \PHPUnit\Framework\MockObject\Matcher\InvokedCount $expectsGetValue
79+
* @param \PHPUnit\Framework\MockObject\Matcher\InvokedCount $expectsSetPath
80+
* @param \PHPUnit\Framework\MockObject\Matcher\InvokedCount $expectsSetScope
81+
* @param \PHPUnit\Framework\MockObject\Matcher\InvokedCount $expectsSetScopeId
82+
* @param \PHPUnit\Framework\MockObject\Matcher\InvokedCount $expectsSetValue
83+
* @param \PHPUnit\Framework\MockObject\Matcher\InvokedCount $expectsAfterLoad
84+
* @param \PHPUnit\Framework\MockObject\Matcher\InvokedCount $expectsSerialize
8585
* @param string $expectsValue
8686
* @param string $className
8787
* @param string $value

Diff for: app/code/Magento/Config/Test/Unit/Model/Config/Structure/ElementVisibilityCompositeTest.php

+4-4
Original file line numberDiff line numberDiff line change
@@ -51,9 +51,9 @@ public function testException()
5151
}
5252

5353
/**
54-
* @param \PHPUnit_Framework_MockObject_Matcher_InvokedCount $firstExpects
54+
* @param \PHPUnit\Framework\MockObject\Matcher\InvokedCount $firstExpects
5555
* @param bool $firstResult
56-
* @param \PHPUnit_Framework_MockObject_Matcher_InvokedCount $secondExpects
56+
* @param \PHPUnit\Framework\MockObject\Matcher\InvokedCount $secondExpects
5757
* @param bool $secondResult
5858
* @param bool $expectedResult
5959
* @dataProvider visibilityDataProvider
@@ -74,9 +74,9 @@ public function testDisabled($firstExpects, $firstResult, $secondExpects, $secon
7474
}
7575

7676
/**
77-
* @param \PHPUnit_Framework_MockObject_Matcher_InvokedCount $firstExpects
77+
* @param \PHPUnit\Framework\MockObject\Matcher\InvokedCount $firstExpects
7878
* @param bool $firstResult
79-
* @param \PHPUnit_Framework_MockObject_Matcher_InvokedCount $secondExpects
79+
* @param \PHPUnit\Framework\MockObject\Matcher\InvokedCount $secondExpects
8080
* @param bool $secondResult
8181
* @param bool $expectedResult
8282
* @dataProvider visibilityDataProvider

Diff for: app/code/Magento/Downloadable/Test/Unit/Ui/DataProvider/Product/Form/Modifier/Data/LinksTest.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -98,8 +98,8 @@ protected function setUp()
9898
/**
9999
* @param int|null $id
100100
* @param string $typeId
101-
* @param \PHPUnit_Framework_MockObject_Matcher_InvokedCount $expectedGetTitle
102-
* @param \PHPUnit_Framework_MockObject_Matcher_InvokedCount $expectedGetValue
101+
* @param \PHPUnit\Framework\MockObject\Matcher\InvokedCount $expectedGetTitle
102+
* @param \PHPUnit\Framework\MockObject\Matcher\InvokedCount $expectedGetValue
103103
* @return void
104104
* @dataProvider getLinksTitleDataProvider
105105
*/

Diff for: app/code/Magento/Reports/Test/Unit/Model/ResourceModel/Order/CollectionTest.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,7 @@ public function testCheckIsLive()
202202
* @param int $useAggregatedData
203203
* @param string $mainTable
204204
* @param int $isFilter
205-
* @param \PHPUnit_Framework_MockObject_Matcher_InvokedCount $getIfNullSqlResult
205+
* @param \PHPUnit\Framework\MockObject\Matcher\InvokedCount $getIfNullSqlResult
206206
* @dataProvider useAggregatedDataDataProvider
207207
* @return void
208208
*/
@@ -309,7 +309,7 @@ public function testAddItemCountExpr()
309309
* @param int $isFilter
310310
* @param int $useAggregatedData
311311
* @param string $mainTable
312-
* @param \PHPUnit_Framework_MockObject_Matcher_InvokedCount $getIfNullSqlResult
312+
* @param \PHPUnit\Framework\MockObject\Matcher\InvokedCount $getIfNullSqlResult
313313
* @dataProvider totalsDataProvider
314314
* @return void
315315
*/

Diff for: app/code/Magento/Reports/Test/Unit/Model/ResourceModel/Report/Product/ViewedTest.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -190,8 +190,8 @@ function ($arg) {
190190
/**
191191
* @param mixed $from
192192
* @param mixed $to
193-
* @param \PHPUnit_Framework_MockObject_Matcher_InvokedCount $truncateCount
194-
* @param \PHPUnit_Framework_MockObject_Matcher_InvokedCount $deleteCount
193+
* @param \PHPUnit\Framework\MockObject\Matcher\InvokedCount $truncateCount
194+
* @param \PHPUnit\Framework\MockObject\Matcher\InvokedCount $deleteCount
195195
* @dataProvider intervalsDataProvider
196196
* @return void
197197
*/

Diff for: app/code/Magento/Sales/Test/Unit/Model/Order/Email/Sender/AbstractSenderTest.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -157,8 +157,8 @@ public function stepIdentityContainerInit($identityMockClassName)
157157
}
158158

159159
protected function stepSend(
160-
\PHPUnit_Framework_MockObject_Matcher_InvokedCount $sendExpects,
161-
\PHPUnit_Framework_MockObject_Matcher_InvokedCount $sendCopyToExpects
160+
\PHPUnit\Framework\MockObject\Matcher\InvokedCount $sendExpects,
161+
\PHPUnit\Framework\MockObject\Matcher\InvokedCount $sendCopyToExpects
162162
) {
163163
$senderMock = $this->createPartialMock(\Magento\Sales\Model\Order\Email\Sender::class, ['send', 'sendCopyTo']);
164164
$senderMock->expects($sendExpects)

Diff for: lib/internal/Magento/Framework/TestFramework/Unit/Block/Adminhtml.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,7 @@ protected function _makeMock($className)
197197
* @param \PHPUnit_Framework_MockObject_MockObject $object
198198
* @param string $stubName
199199
* @param mixed $return
200-
* @param \PHPUnit_Framework_MockObject_Matcher_InvokedCount|null $expects
200+
* @param \PHPUnit\Framework\MockObject\Matcher\InvokedCount|null $expects
201201
*
202202
* @return \PHPUnit_Framework_MockObject_Builder_InvocationMocker
203203
*/

Diff for: lib/internal/Magento/Framework/TestFramework/Unit/Helper/ProxyTesting.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -40,12 +40,12 @@ public function invokeWithExpectations(
4040
$expectedParams = $params;
4141
}
4242
$builder = $proxiedObject->expects(
43-
new \PHPUnit_Framework_MockObject_Matcher_InvokedCount(1)
43+
new \PHPUnit\Framework\MockObject\Matcher\InvokedCount(1)
4444
)->method(
4545
$expectedMethod
4646
);
4747
$builder = call_user_func_array([$builder, 'with'], $expectedParams);
48-
$builder->will(new \PHPUnit_Framework_MockObject_Stub_Return($proxiedResult));
48+
$builder->will(new \PHPUnit\Framework\MockObject\Stub\ReturnStub($proxiedResult));
4949

5050
return call_user_func_array([$object, $method], $params);
5151
}

Diff for: lib/internal/Magento/Framework/View/Test/Unit/Element/AbstractBlockTest.php

+3-3
Original file line numberDiff line numberDiff line change
@@ -220,9 +220,9 @@ public function testToHtmlWhenModuleIsDisabled()
220220
* @param string|bool $cacheLifetime
221221
* @param string|bool $dataFromCache
222222
* @param string $dataForSaveCache
223-
* @param \PHPUnit_Framework_MockObject_Matcher_InvokedCount $expectsDispatchEvent
224-
* @param \PHPUnit_Framework_MockObject_Matcher_InvokedCount $expectsCacheLoad
225-
* @param \PHPUnit_Framework_MockObject_Matcher_InvokedCount $expectsCacheSave
223+
* @param \PHPUnit\Framework\MockObject\Matcher\InvokedCount $expectsDispatchEvent
224+
* @param \PHPUnit\Framework\MockObject\Matcher\InvokedCount $expectsCacheLoad
225+
* @param \PHPUnit\Framework\MockObject\Matcher\InvokedCount $expectsCacheSave
226226
* @param string $expectedResult
227227
* @return void
228228
* @dataProvider getCacheLifetimeDataProvider

Diff for: lib/internal/Magento/Framework/View/Test/Unit/Layout/Data/StructureTest.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ protected function setUp()
4949
}
5050

5151
/**
52-
* @param \PHPUnit_Framework_MockObject_Matcher_InvokedCount $loggerExpects
52+
* @param \PHPUnit\Framework\MockObject\Matcher\InvokedCount $loggerExpects
5353
* @param string $stateMode
5454
* @return void
5555
* @dataProvider reorderChildElementLogDataProvider

Diff for: lib/internal/Magento/Framework/View/Test/Unit/Layout/Generator/BlockTest.php

+4-4
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,10 @@ class BlockTest extends \PHPUnit\Framework\TestCase
2020
* @param array $testArgumentData
2121
* @param bool $testIsFlag
2222
* @param bool $isNeedEvaluate
23-
* @param \PHPUnit_Framework_MockObject_Matcher_InvokedCount $addToParentGroupCount
24-
* @param \PHPUnit_Framework_MockObject_Matcher_InvokedCount $setTemplateCount
25-
* @param \PHPUnit_Framework_MockObject_Matcher_InvokedCount $setTtlCount
26-
* @param \PHPUnit_Framework_MockObject_Matcher_InvokedCount $setIsFlag
23+
* @param \PHPUnit\Framework\MockObject\Matcher\InvokedCount $addToParentGroupCount
24+
* @param \PHPUnit\Framework\MockObject\Matcher\InvokedCount $setTemplateCount
25+
* @param \PHPUnit\Framework\MockObject\Matcher\InvokedCount $setTtlCount
26+
* @param \PHPUnit\Framework\MockObject\Matcher\InvokedCount $setIsFlag
2727
* @dataProvider provider
2828
*
2929
* @SuppressWarnings(PHPMD.ExcessiveMethodLength)

Diff for: lib/internal/Magento/Framework/View/Test/Unit/Layout/Reader/BlockTest.php

+6-6
Original file line numberDiff line numberDiff line change
@@ -89,11 +89,11 @@ protected function setUp()
8989

9090
/**
9191
* @param string $literal
92-
* @param \PHPUnit_Framework_MockObject_Matcher_InvokedCount $scheduleStructureCount
92+
* @param \PHPUnit\Framework\MockObject\Matcher\InvokedCount $scheduleStructureCount
9393
* @param string $ifconfigValue
9494
* @param array $expectedConditions
95-
* @param \PHPUnit_Framework_MockObject_Matcher_InvokedCount $getCondition
96-
* @param \PHPUnit_Framework_MockObject_Matcher_InvokedCount $setCondition
95+
* @param \PHPUnit\Framework\MockObject\Matcher\InvokedCount $getCondition
96+
* @param \PHPUnit\Framework\MockObject\Matcher\InvokedCount $setCondition
9797
* @param string $aclKey
9898
* @param string $aclValue
9999
*
@@ -238,9 +238,9 @@ public function processBlockDataProvider()
238238
/**
239239
* @param string $literal
240240
* @param string $remove
241-
* @param \PHPUnit_Framework_MockObject_Matcher_InvokedCount $getCondition
242-
* @param \PHPUnit_Framework_MockObject_Matcher_InvokedCount $setCondition
243-
* @param \PHPUnit_Framework_MockObject_Matcher_InvokedCount $setRemoveCondition
241+
* @param \PHPUnit\Framework\MockObject\Matcher\InvokedCount $getCondition
242+
* @param \PHPUnit\Framework\MockObject\Matcher\InvokedCount $setCondition
243+
* @param \PHPUnit\Framework\MockObject\Matcher\InvokedCount $setRemoveCondition
244244
* @dataProvider processReferenceDataProvider
245245
*/
246246
public function testProcessReference(

Diff for: lib/internal/Magento/Framework/View/Test/Unit/Layout/Reader/ContainerTest.php

+3-3
Original file line numberDiff line numberDiff line change
@@ -56,9 +56,9 @@ protected function setUp()
5656
* @param string $containerName
5757
* @param array $structureElement
5858
* @param array $expectedData
59-
* @param \PHPUnit_Framework_MockObject_Matcher_InvokedCount $getStructureCondition
60-
* @param \PHPUnit_Framework_MockObject_Matcher_InvokedCount $setStructureCondition
61-
* @param \PHPUnit_Framework_MockObject_Matcher_InvokedCount $setRemoveCondition
59+
* @param \PHPUnit\Framework\MockObject\Matcher\InvokedCount $getStructureCondition
60+
* @param \PHPUnit\Framework\MockObject\Matcher\InvokedCount $setStructureCondition
61+
* @param \PHPUnit\Framework\MockObject\Matcher\InvokedCount $setRemoveCondition
6262
*
6363
* @dataProvider processDataProvider
6464
*/

Diff for: lib/internal/Magento/Framework/View/Test/Unit/Layout/ScheduledStructure/HelperTest.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ public function testScheduleNonExistentElement()
144144
}
145145

146146
/**
147-
* @param \PHPUnit_Framework_MockObject_Matcher_InvokedCount $loggerExpects
147+
* @param \PHPUnit\Framework\MockObject\Matcher\InvokedCount $loggerExpects
148148
* @param string $stateMode
149149
* @return void
150150
* @dataProvider scheduleElementLogDataProvider

Diff for: lib/internal/Magento/Framework/View/Test/Unit/Result/LayoutTest.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -98,8 +98,8 @@ public function testAddUpdate()
9898
* @param string $headerName
9999
* @param string $headerValue
100100
* @param bool $replaceHeader
101-
* @param \PHPUnit_Framework_MockObject_Matcher_InvokedCount $setHttpResponseCodeCount
102-
* @param \PHPUnit_Framework_MockObject_Matcher_InvokedCount $setHeaderCount
101+
* @param \PHPUnit\Framework\MockObject\Matcher\InvokedCount $setHttpResponseCodeCount
102+
* @param \PHPUnit\Framework\MockObject\Matcher\InvokedCount $setHeaderCount
103103
* @dataProvider renderResultDataProvider
104104
*/
105105
public function testRenderResult(

0 commit comments

Comments
 (0)