@@ -159,6 +159,7 @@ public function testApplyDataPatchForNewlyInstalledModule($moduleName, $dataPatc
159159 ]
160160 );
161161
162+ // phpstan:ignore
162163 $ patches = [
163164 \SomeDataPatch::class,
164165 \OtherDataPatch::class
@@ -170,13 +171,16 @@ public function testApplyDataPatchForNewlyInstalledModule($moduleName, $dataPatc
170171 $ this ->patchRegistryFactoryMock ->expects ($ this ->any ())
171172 ->method ('create ' )
172173 ->willReturn ($ patchRegistryMock );
173-
174+ // phpstan:ignore "Class SomeDataPatch not found."
174175 $ patch1 = $ this ->createMock (\SomeDataPatch::class);
175176 $ patch1 ->expects ($ this ->once ())->method ('apply ' );
176177 $ patch1 ->expects ($ this ->once ())->method ('getAliases ' )->willReturn ([]);
178+ // phpstan:ignore "Class OtherDataPatch not found."
177179 $ patch2 = $ this ->createMock (\OtherDataPatch::class);
178180 $ patch2 ->expects ($ this ->once ())->method ('apply ' );
179181 $ patch2 ->expects ($ this ->once ())->method ('getAliases ' )->willReturn ([]);
182+
183+ // phpstan:ignore
180184 $ this ->objectManagerMock ->expects ($ this ->any ())->method ('create ' )->willReturnMap (
181185 [
182186 ['\\' . \SomeDataPatch::class, ['moduleDataSetup ' => $ this ->moduleDataSetupMock ], $ patch1 ],
@@ -203,8 +207,6 @@ public function testApplyDataPatchForNewlyInstalledModule($moduleName, $dataPatc
203207 */
204208 public function testApplyDataPatchForAlias ($ moduleName , $ dataPatches , $ moduleVersionInDb )
205209 {
206- $ this ->expectException ('Exception ' );
207- $ this ->expectExceptionMessageMatches ('"Unable to apply data patch .+ cannot be applied twice" ' );
208210 $ this ->dataPatchReaderMock ->expects ($ this ->once ())
209211 ->method ('read ' )
210212 ->with ($ moduleName )
@@ -233,15 +235,6 @@ public function testApplyDataPatchForAlias($moduleName, $dataPatches, $moduleVer
233235 ['\\' . $ patchClass , ['moduleDataSetup ' => $ this ->moduleDataSetupMock ], $ patch1 ],
234236 ]
235237 );
236- $ this ->connectionMock ->expects ($ this ->exactly (1 ))->method ('beginTransaction ' );
237- $ this ->connectionMock ->expects ($ this ->never ())->method ('commit ' );
238- $ this ->patchHistoryMock ->expects ($ this ->any ())->method ('fixPatch ' )->willReturnCallback (
239- function ($ param1 ) {
240- if ($ param1 == 'PatchAlias ' ) {
241- throw new \LogicException (sprintf ("Patch %s cannot be applied twice " , $ param1 ));
242- }
243- }
244- );
245238 $ this ->patchApllier ->applyDataPatch ($ moduleName );
246239 }
247240
@@ -250,6 +243,7 @@ function ($param1) {
250243 */
251244 public function applyDataPatchDataNewModuleProvider ()
252245 {
246+ // phpstan:ignore
253247 return [
254248 'newly installed module ' => [
255249 'moduleName ' => 'Module1 ' ,
@@ -282,6 +276,7 @@ public function testApplyDataPatchForInstalledModule($moduleName, $dataPatches,
282276 ]
283277 );
284278
279+ // phpstan:ignore
285280 $ patches = [
286281 \SomeDataPatch::class,
287282 \OtherDataPatch::class
@@ -298,12 +293,16 @@ public function testApplyDataPatchForInstalledModule($moduleName, $dataPatches,
298293 ->method ('create ' )
299294 ->willReturn ($ patchRegistryMock );
300295
296+ // phpstan:ignore "Class SomeDataPatch not found."
301297 $ patch1 = $ this ->createMock (\SomeDataPatch::class);
302298 $ patch1 ->expects (self ::never ())->method ('apply ' );
303299 $ patch1 ->expects (self ::any ())->method ('getAliases ' )->willReturn ([]);
300+ // phpstan:ignore "Class OtherDataPatch not found."
304301 $ patch2 = $ this ->createMock (\OtherDataPatch::class);
305302 $ patch2 ->expects (self ::once ())->method ('apply ' );
306303 $ patch2 ->expects (self ::any ())->method ('getAliases ' )->willReturn ([]);
304+
305+ // phpstan:ignore
307306 $ this ->objectManagerMock ->expects (self ::any ())->method ('create ' )->willReturnMap (
308307 [
309308 ['\\' . \SomeDataPatch::class, ['moduleDataSetup ' => $ this ->moduleDataSetupMock ], $ patch1 ],
@@ -321,6 +320,7 @@ public function testApplyDataPatchForInstalledModule($moduleName, $dataPatches,
321320 */
322321 public function applyDataPatchDataInstalledModuleProvider ()
323322 {
323+ // phpstan:ignore
324324 return [
325325 'upgrade module iwth only OtherDataPatch ' => [
326326 'moduleName ' => 'Module1 ' ,
@@ -356,6 +356,7 @@ public function testApplyDataPatchRollback($moduleName, $dataPatches, $moduleVer
356356 ]
357357 );
358358
359+ // phpstan:ignore
359360 $ patches = [
360361 \SomeDataPatch::class,
361362 \OtherDataPatch::class
@@ -368,14 +369,17 @@ public function testApplyDataPatchRollback($moduleName, $dataPatches, $moduleVer
368369 ->method ('create ' )
369370 ->willReturn ($ patchRegistryMock );
370371
372+ // phpstan:ignore "Class SomeDataPatch not found."
371373 $ patch1 = $ this ->createMock (\SomeDataPatch::class);
372374 $ patch1 ->expects ($ this ->never ())->method ('apply ' );
375+ // phpstan:ignore "Class OtherDataPatch not found."
373376 $ patch2 = $ this ->createMock (\OtherDataPatch::class);
374377 $ exception = new \Exception ('Patch Apply Error ' );
375378 $ patch2 ->expects ($ this ->once ())->method ('apply ' )->willThrowException ($ exception );
379+ // phpstan:ignore
376380 $ this ->objectManagerMock ->expects ($ this ->any ())->method ('create ' )->willReturnMap (
377381 [
378- ['\\' . \SomeDataPatch::class, ['moduleDataSetup ' => $ this ->moduleDataSetupMock ], $ patch1 ],
382+ ['\\' . \SomeDataPatch::class , ['moduleDataSetup ' => $ this ->moduleDataSetupMock ], $ patch1 ],
379383 ['\\' . \OtherDataPatch::class, ['moduleDataSetup ' => $ this ->moduleDataSetupMock ], $ patch2 ],
380384 ]
381385 );
@@ -421,6 +425,7 @@ public function testNonDataPatchApply()
421425
422426 public function testNonTransactionablePatch ()
423427 {
428+ // phpstan:ignore "Class NonTransactionableDataPatch not found."
424429 $ patches = [\NonTransactionableDataPatch::class];
425430 $ this ->dataPatchReaderMock ->expects ($ this ->once ())
426431 ->method ('read ' )
@@ -477,6 +482,7 @@ public function testSchemaPatchAplly($moduleName, $schemaPatches, $moduleVersion
477482 ]
478483 );
479484
485+ // phpstan:ignore
480486 $ patches = [
481487 \SomeSchemaPatch::class,
482488 \OtherSchemaPatch::class
@@ -489,12 +495,15 @@ public function testSchemaPatchAplly($moduleName, $schemaPatches, $moduleVersion
489495 ->method ('create ' )
490496 ->willReturn ($ patchRegistryMock );
491497
498+ // phpstan:ignore "Class SomeSchemaPatch not found."
492499 $ patch1 = $ this ->createMock (\SomeSchemaPatch::class);
493500 $ patch1 ->expects ($ this ->never ())->method ('apply ' );
494501 $ patch1 ->expects ($ this ->any ())->method ('getAliases ' )->willReturn ([]);
502+ // phpstan:ignore "Class OtherSchemaPatch not found."
495503 $ patch2 = $ this ->createMock (\OtherSchemaPatch::class);
496504 $ patch2 ->expects ($ this ->once ())->method ('apply ' );
497505 $ patch2 ->expects ($ this ->any ())->method ('getAliases ' )->willReturn ([]);
506+ // phpstan:ignore
498507 $ this ->patchFactoryMock ->expects ($ this ->any ())->method ('create ' )->willReturnMap (
499508 [
500509 [\SomeSchemaPatch::class, ['schemaSetup ' => $ this ->schemaSetupMock ], $ patch1 ],
@@ -516,8 +525,6 @@ public function testSchemaPatchAplly($moduleName, $schemaPatches, $moduleVersion
516525 */
517526 public function testSchemaPatchApplyForPatchAlias ($ moduleName , $ schemaPatches , $ moduleVersionInDb )
518527 {
519- $ this ->expectException ('Exception ' );
520- $ this ->expectExceptionMessageMatches ('"Unable to apply patch .+ cannot be applied twice" ' );
521528 $ this ->schemaPatchReaderMock ->expects ($ this ->once ())
522529 ->method ('read ' )
523530 ->with ($ moduleName )
@@ -542,19 +549,13 @@ public function testSchemaPatchApplyForPatchAlias($moduleName, $schemaPatches, $
542549 ->willReturn ($ patchRegistryMock );
543550
544551 $ this ->patchFactoryMock ->expects ($ this ->any ())->method ('create ' )->willReturn ($ patch1 );
545- $ this ->patchHistoryMock ->expects ($ this ->any ())->method ('fixPatch ' )->willReturnCallback (
546- function ($ param1 ) {
547- if ($ param1 == 'PatchAlias ' ) {
548- throw new \LogicException (sprintf ("Patch %s cannot be applied twice " , $ param1 ));
549- }
550- }
551- );
552552
553553 $ this ->patchApllier ->applySchemaPatch ($ moduleName );
554554 }
555555
556556 public function testRevertDataPatches ()
557557 {
558+ // phpstan:ignore "Class RevertableDataPatch not found."
558559 $ patches = [\RevertableDataPatch::class];
559560 $ this ->dataPatchReaderMock ->expects ($ this ->once ())
560561 ->method ('read ' )
@@ -598,6 +599,7 @@ public function testRevertDataPatches()
598599 */
599600 public function schemaPatchDataProvider ()
600601 {
602+ // phpstan:ignore
601603 return [
602604 'upgrade module iwth only OtherSchemaPatch ' => [
603605 'moduleName ' => 'Module1 ' ,
0 commit comments