File tree Expand file tree Collapse file tree 2 files changed +10
-2
lines changed
app/code/Magento/AsynchronousOperations Expand file tree Collapse file tree 2 files changed +10
-2
lines changed Original file line number Diff line number Diff line change 14
14
use Magento \AsynchronousOperations \Api \Data \OperationExtensionInterfaceFactory ;
15
15
use Magento \AsynchronousOperations \Model \ResourceModel \Operation \CollectionFactory ;
16
16
use Magento \Framework \Api \ExtensionAttribute \JoinProcessorInterface ;
17
- use Magento \Framework \Exception \InputException ;
18
- use Magento \Framework \Exception \NoSuchEntityException ;
19
17
20
18
/**
21
19
* Repository class for @see \Magento\AsynchronousOperations\Api\OperationRepositoryInterface
Original file line number Diff line number Diff line change @@ -152,16 +152,26 @@ protected function setUp(): void
152
152
}
153
153
154
154
/**
155
+ * Check for Get List methods if its calling addFieldToSelect method
156
+ *
155
157
* @return void
156
158
*/
157
159
public function testGetListSelect (): void
158
160
{
159
161
$ 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
+
160
169
$ searchCriteria = $ this ->createMock (SearchCriteriaInterface::class);
161
170
$ this ->searchResultFactory ->expects ($ this ->once ())->method ('create ' )->willReturn ($ searchResultInterface );
162
171
$ operationCollection = $ this ->createMock (OperationCollection::class);
163
172
164
173
$ operationCollection ->expects ($ this ->once ())->method ('getItems ' )->willReturn ($ this ->items );
174
+ $ operationCollection ->expects ($ this ->once ())->method ('getSize ' )->willReturn (count ($ this ->items ));
165
175
$ operationCollection ->expects ($ this ->exactly (3 ))->method ('addFieldToSelect ' )->willReturnSelf ();
166
176
$ this ->operationCollectionFactory ->expects ($ this ->once ())->method ('create ' )->willReturn ($ operationCollection );
167
177
$ this ->model ->getList ($ searchCriteria );
You can’t perform that action at this time.
0 commit comments