File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -157,25 +157,10 @@ public function getList(\Magento\Framework\Api\SearchCriteriaInterface $criteria
157157
158158 $ this ->collectionProcessor ->process ($ criteria , $ collection );
159159
160- $ pages = [];
161- /** @var Page $pageModel */
162- foreach ($ collection as $ pageModel ) {
163- $ pageData = $ this ->dataPageFactory ->create ();
164- $ this ->dataObjectHelper ->populateWithArray (
165- $ pageData ,
166- $ pageModel ->getData (),
167- \Magento \Cms \Api \Data \PageInterface::class
168- );
169- $ pages [] = $ this ->dataObjectProcessor ->buildOutputDataArray (
170- $ pageData ,
171- \Magento \Cms \Api \Data \PageInterface::class
172- );
173- }
174-
175160 /** @var Data\PageSearchResultsInterface $searchResults */
176161 $ searchResults = $ this ->searchResultsFactory ->create ();
177162 $ searchResults ->setSearchCriteria ($ criteria );
178- $ searchResults ->setItems ($ pages );
163+ $ searchResults ->setItems ($ collection -> getItems () );
179164 $ searchResults ->setTotalCount ($ collection ->getSize ());
180165 return $ searchResults ;
181166 }
Original file line number Diff line number Diff line change @@ -261,22 +261,8 @@ public function testGetList()
261261 ->willReturnSelf ();
262262 $ this ->pageSearchResult ->expects ($ this ->once ())
263263 ->method ('setItems ' )
264- ->with ([' someData ' ])
264+ ->with ([$ this -> page ])
265265 ->willReturnSelf ();
266-
267- $ this ->page ->expects ($ this ->once ())
268- ->method ('getData ' )
269- ->willReturn (['data ' ]);
270-
271- $ this ->dataHelper ->expects ($ this ->once ())
272- ->method ('populateWithArray ' )
273- ->with ($ this ->pageData , ['data ' ], \Magento \Cms \Api \Data \PageInterface::class);
274-
275- $ this ->dataObjectProcessor ->expects ($ this ->once ())
276- ->method ('buildOutputDataArray ' )
277- ->with ($ this ->pageData , \Magento \Cms \Api \Data \PageInterface::class)
278- ->willReturn ('someData ' );
279-
280266 $ this ->assertEquals ($ this ->pageSearchResult , $ this ->repository ->getList ($ criteria ));
281267 }
282268}
You can’t perform that action at this time.
0 commit comments