Skip to content

Fix Patch aliases usage (issue #31396) #38239

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 14 commits into
base: 2.4-develop
Choose a base branch
from
Open
Prev Previous commit
Next Next commit
Fix unit tests
  • Loading branch information
thomas-kl1 authored Dec 6, 2023
commit cd91e89223c038aace3d437d8e3c4c3e160ce48e
Original file line number Diff line number Diff line change
Expand Up @@ -166,20 +166,17 @@ public function testApplyDataPatchForNewlyInstalledModule($moduleName, $dataPatc
\OtherDataPatch::class
];
$patchRegistryMock = $this->createAggregateIteratorMock(PatchRegistry::class, $patches, ['registerPatch']);
$patchRegistryMock->expects($this->exactly(2))
->method('registerPatch');
$patchRegistryMock->expects($this->exactly(2))->method('registerPatch');

$this->patchRegistryFactoryMock->expects($this->any())
->method('create')
->willReturn($patchRegistryMock);
$this->patchRegistryFactoryMock->expects($this->any())->method('create')->willReturn($patchRegistryMock);
// phpstan:ignore "Class SomeDataPatch not found."
$patch1 = $this->createMock(\SomeDataPatch::class);
$patch1->expects($this->once())->method('apply');
$patch1->expects($this->once())->method('getAliases')->willReturn([]);
$patch1->expects($this->any())->method('getAliases')->willReturn([]);
// phpstan:ignore "Class OtherDataPatch not found."
$patch2 = $this->createMock(\OtherDataPatch::class);
$patch2->expects($this->once())->method('apply');
$patch2->expects($this->once())->method('getAliases')->willReturn([]);
$patch2->expects($this->any())->method('getAliases')->willReturn([]);

$this->objectManagerMock->expects($this->any())->method('create')->willReturnMap(
[
Expand Down