Skip to content

Commit c828372

Browse files
committed
fix no orders
1 parent 16cc950 commit c828372

File tree

2 files changed

+14
-1
lines changed

2 files changed

+14
-1
lines changed

src/Request/ShopifyBaseRequest.php

+6-1
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,12 @@ public function buildFromBulkResponse(Response $response) : array
9292
} while(!$bulkOpIsDone);
9393

9494
// When an operation is completed, a JSONL output file is available for download at the URL specified in the url field
95-
$dataUrl = $oResponse->data->currentBulkOperation->url;
95+
$dataUrl = $oResponse->data->currentBulkOperation->url ?? null;
96+
97+
// there are NO items
98+
if( empty($dataUrl) ) {
99+
return [];
100+
}
96101

97102
$txtJson =
98103
$this->getHttpClient()

tests/ShopifyOrderListRequestTest.php

+8
Original file line numberDiff line numberDiff line change
@@ -44,4 +44,12 @@ public function testGetNewOrders()
4444
}
4545
}
4646
}
47+
48+
49+
public function testNoNewOrders()
50+
{
51+
$rqOrders = $this->getInstance();
52+
$arrOrders = $rqOrders->getRecent(0);
53+
$this->assertEmpty($arrOrders);
54+
}
4755
}

0 commit comments

Comments
 (0)