File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 214214 expect ($ pagination ['paginate ' ]['next_page ' ])->toEqual ('/events?page=2 ' );
215215});
216216
217+ test ('can paginate between occurrences ' , function () {
218+ Carbon::setTestNow (now ()->setTimeFromTimeString ('10:00 ' ));
219+
220+ $ this ->tag
221+ ->setContext ([])
222+ ->setParameters ([
223+ 'collection ' => 'events ' ,
224+ 'from ' => now ()->subDay (),
225+ 'to ' => now ()->addWeeks (4 ),
226+ 'paginate ' => 2 ,
227+ ]);
228+
229+ Cascade::partialMock ()->shouldReceive ('get ' )
230+ ->with ('uri ' )
231+ ->andReturn ('/events ' );
232+
233+ $ pagination = $ this ->tag ->between ();
234+
235+ expect ($ pagination )
236+ ->toHaveKey ('results ' )
237+ ->toHaveKey ('paginate ' )
238+ ->toHaveKey ('total_results ' );
239+
240+ expect ($ pagination ['results ' ])->toHaveCount (2 );
241+ expect ($ pagination ['total_results ' ])->toEqual (2 );
242+ expect ($ pagination ['paginate ' ]['next_page ' ])->toEqual ('/events?page=2 ' );
243+ });
244+
217245test ('can generate upcoming occurrences with taxonomy terms ' , function () {
218246 Carbon::setTestNow (now ()->setTimeFromTimeString ('10:00 ' ));
219247
274302 ->first ()->title ->toBe ('Single Event ' );
275303});
276304
277- test ('can generate upcoming occurrences with filter ' , function () {
305+ test ('can generate between occurrences with filter ' , function () {
278306 Carbon::setTestNow (now ()->setTimeFromTimeString ('10:00 ' ));
279307
280308 Entry::make ()
You can’t perform that action at this time.
0 commit comments