From 9d9392fcb8777204a5f09e7f59c64642ee5bbd81 Mon Sep 17 00:00:00 2001 From: Andrea Marco Sartori Date: Sun, 21 Jan 2024 23:48:17 +1000 Subject: [PATCH] Create test for sources --- tests/Feature/SourceTest.php | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 tests/Feature/SourceTest.php diff --git a/tests/Feature/SourceTest.php b/tests/Feature/SourceTest.php new file mode 100644 index 0000000..fda6fea --- /dev/null +++ b/tests/Feature/SourceTest.php @@ -0,0 +1,16 @@ +totalPages('meta.total_pages') + ->collect('data.*'); + + expect($lazyCollection)->toLoadItemsViaRequests($expectedItems, [ + 'https://example.com/api/v1/users' => 'totalPages/page1.json', + 'https://example.com/api/v1/users?page=2' => 'totalPages/page2.json', + 'https://example.com/api/v1/users?page=3' => 'totalPages/page3.json', + ]); +})->with('sources');