File tree 1 file changed +9
-4
lines changed
1 file changed +9
-4
lines changed Original file line number Diff line number Diff line change 27
27
use Mockery ;
28
28
use Mockery \MockInterface ;
29
29
use PHPUnit \Framework \MockObject \MockObject ;
30
- use PKP \core \ArrayItemIterator ;
31
30
use PKP \db \DAORegistry ;
31
+ use PKP \db \DAOResultFactory ;
32
32
use PKP \plugins \Hook ;
33
33
use PKP \submissionFile \Collector as SubmissionFileCollector ;
34
34
use PKP \submissionFile \SubmissionFile ;
@@ -411,10 +411,15 @@ private function registerMockJournalDAO()
411
411
->getMock ();
412
412
413
413
// Mock an empty result set.
414
- $ journals = [];
415
- $ journalsIterator = new ArrayItemIterator ($ journals );
414
+ $ journalsIterator = $ this ->getMockBuilder (DAOResultFactory::class)
415
+ ->disableOriginalConstructor ()
416
+ ->onlyMethods (['toIterator ' ])
417
+ ->getMock ();
418
+ $ journalsIterator
419
+ ->method ('toIterator ' )
420
+ ->will ($ this ->returnValue ([]));
416
421
417
- // Mock the getById () method.
422
+ // Mock the getAll () method.
418
423
$ journalDao ->expects ($ this ->any ())
419
424
->method ('getAll ' )
420
425
->will ($ this ->returnValue ($ journalsIterator ));
You can’t perform that action at this time.
0 commit comments