Skip to content

Commit 57acde6

Browse files
author
Mohan Ahuja
committed
ACP2E-726: Unable to query bulk operations by search criteria using REST Api
- Fixed CR comments
1 parent 29260ef commit 57acde6

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

app/code/Magento/AsynchronousOperations/Model/OperationRepository.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,6 @@
1414
use Magento\AsynchronousOperations\Api\Data\OperationExtensionInterfaceFactory;
1515
use Magento\AsynchronousOperations\Model\ResourceModel\Operation\CollectionFactory;
1616
use Magento\Framework\Api\ExtensionAttribute\JoinProcessorInterface;
17-
use Magento\Framework\Exception\InputException;
18-
use Magento\Framework\Exception\NoSuchEntityException;
1917

2018
/**
2119
* Repository class for @see \Magento\AsynchronousOperations\Api\OperationRepositoryInterface

app/code/Magento/AsynchronousOperations/Test/Unit/Model/OperationRepositoryTest.php

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -152,16 +152,26 @@ protected function setUp(): void
152152
}
153153

154154
/**
155+
* Check for Get List methods if its calling addFieldToSelect method
156+
*
155157
* @return void
156158
*/
157159
public function testGetListSelect(): void
158160
{
159161
$searchResultInterface = $this->createMock(OperationSearchResultsInterface::class);
162+
$searchResultInterface->expects($this->once())->method('setSearchCriteria')->willReturnSelf();
163+
$searchResultInterface->expects($this->once())->method('setTotalCount')->willReturnSelf();
164+
$searchResultInterface->expects($this->once())->method('setItems')->willReturnSelf();
165+
166+
$this->joinProcessor->expects($this->once())->method('process');
167+
$this->collectionProcessor->expects($this->once())->method('process');
168+
160169
$searchCriteria = $this->createMock(SearchCriteriaInterface::class);
161170
$this->searchResultFactory->expects($this->once())->method('create')->willReturn($searchResultInterface);
162171
$operationCollection = $this->createMock(OperationCollection::class);
163172

164173
$operationCollection->expects($this->once())->method('getItems')->willReturn($this->items);
174+
$operationCollection->expects($this->once())->method('getSize')->willReturn(count($this->items));
165175
$operationCollection->expects($this->exactly(3))->method('addFieldToSelect')->willReturnSelf();
166176
$this->operationCollectionFactory->expects($this->once())->method('create')->willReturn($operationCollection);
167177
$this->model->getList($searchCriteria);

0 commit comments

Comments
 (0)