- Notifications
You must be signed in to change notification settings - Fork 9.4k
#27504 fix joinprocessor behavior with consecutive calls #37550
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
Merged
magento-devops-reposync-svc merged 11 commits into magento:2.4-develop from fgerodez:2.4-develop Feb 17, 2025
Merged
Changes from all commits
Commits
Show all changes
11 commits Select commit Hold shift + click to select a range
2fe04a0
#27504 fix joinprocessor behavior with consecutive calls
fgerodez 5ea9b91
Merge branch '2.4-develop' into 2.4-develop
engcom-Hotel d08f696
Merge branch '2.4-develop' into 2.4-develop
andrewbess 3fd0487
Update dev/tests/integration/testsuite/Magento/Framework/Api/SearchCr…
fgerodez 2dec313
Merge branch '2.4-develop' into 2.4-develop
andrewbess 5bdaf2f
Merge branch '2.4-develop' into 2.4-develop
engcom-Dash 72bb6ef
Merge branch '2.4-develop' into 2.4-develop
engcom-Dash d400205
Merge branch '2.4-develop' into 2.4-develop
engcom-Dash b14cd9f
Merge branch '2.4-develop' into 2.4-develop
engcom-Hotel 751b1ca
37550: implement suggested changes
engcom-Dash 24de63e
Merge branch '2.4-develop' into 2.4-develop
engcom-Dash File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
66 changes: 66 additions & 0 deletions 66 .../testsuite/Magento/Framework/Api/SearchCriteria/CollectionProcessor/JoinProcessorTest.php
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
<?php | ||
/** | ||
* Copyright 2023 Adobe | ||
* All Rights Reserved. | ||
*/ | ||
declare(strict_types=1); | ||
| ||
namespace Magento\Framework\Api\SearchCriteria\CollectionProcessor; | ||
| ||
use Magento\Framework\Api\SearchCriteria\CollectionProcessor\JoinProcessor\CustomJoinInterface; | ||
use Magento\Framework\Api\SearchCriteriaBuilder; | ||
use Magento\Framework\Data\Collection\AbstractDb; | ||
use Magento\Framework\ObjectManagerInterface; | ||
use Magento\TestFramework\Helper\Bootstrap; | ||
use PHPUnit\Framework\TestCase; | ||
| ||
class JoinProcessorTest extends TestCase | ||
{ | ||
/** | ||
* @var ObjectManagerInterface | ||
*/ | ||
private $objectManager; | ||
| ||
protected function setUp(): void | ||
{ | ||
$this->objectManager = Bootstrap::getObjectManager(); | ||
} | ||
| ||
/** | ||
* Test proper application of the join processor for consecutive calls with different collections. | ||
* | ||
* @return void | ||
*/ | ||
public function testMultipleCollections(): void | ||
{ | ||
$customJoinMock = $this->getMockBuilder(CustomJoinInterface::class) | ||
->getMock(); | ||
| ||
$customJoinMock->expects($this->exactly(2)) | ||
->method('apply'); | ||
| ||
$joinProcessor = $this->objectManager->create(JoinProcessor::class, [ | ||
'customJoins' => [ | ||
'test_join' => $customJoinMock, | ||
], | ||
'fieldMapping' => [ | ||
'test_field' => 'test_join', | ||
], | ||
]); | ||
| ||
$searchCriteria = $this->objectManager->create(SearchCriteriaBuilder::class) | ||
->addFilter('test_field', 'test') | ||
->create(); | ||
| ||
$collection1 = $this->getMockBuilder(AbstractDb::class) | ||
->disableOriginalConstructor() | ||
->getMock(); | ||
| ||
$collection2 = $this->getMockBuilder(AbstractDb::class) | ||
->disableOriginalConstructor() | ||
->getMock(); | ||
| ||
$joinProcessor->process($searchCriteria, $collection1); | ||
$joinProcessor->process($searchCriteria, $collection2); | ||
} | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit. This suggestion is invalid because no changes were made to the code. Suggestions cannot be applied while the pull request is closed. Suggestions cannot be applied while viewing a subset of changes. Only one suggestion per line can be applied in a batch. Add this suggestion to a batch that can be applied as a single commit. Applying suggestions on deleted lines is not supported. You must change the existing code in this line in order to create a valid suggestion. Outdated suggestions cannot be applied. This suggestion has been applied or marked resolved. Suggestions cannot be applied from pending reviews. Suggestions cannot be applied on multi-line comments. Suggestions cannot be applied while the pull request is queued to merge. Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.