diff --git a/src/Domains/Connectors/Zoho/Actions/DownloadAllZohoLeadAction.php b/src/Domains/Connectors/Zoho/Actions/DownloadAllZohoLeadAction.php index 5ed7eab31..f708e8b29 100644 --- a/src/Domains/Connectors/Zoho/Actions/DownloadAllZohoLeadAction.php +++ b/src/Domains/Connectors/Zoho/Actions/DownloadAllZohoLeadAction.php @@ -42,7 +42,7 @@ public function execute($totalPages = 50, $leadsPerPage = 200): Generator } $this->totalLeadsProcessed++; - yield $localLead->getId(); + yield $localLead; } } } diff --git a/tests/Connectors/Integration/Zoho/LeadTest.php b/tests/Connectors/Integration/Zoho/LeadTest.php index 7f9ed0a23..739ea4182 100644 --- a/tests/Connectors/Integration/Zoho/LeadTest.php +++ b/tests/Connectors/Integration/Zoho/LeadTest.php @@ -11,6 +11,7 @@ use Kanvas\Guild\Enums\FlagEnum; use Kanvas\Guild\Leads\Actions\CreateLeadReceiverAction; use Kanvas\Guild\Leads\DataTransferObject\LeadReceiver; +use Kanvas\Guild\Leads\Models\Lead; use Kanvas\Guild\Support\Setup; use Tests\TestCase; @@ -50,6 +51,10 @@ public function testDownloadAllLeads(): void $leads = $downloadAllLeads->execute(totalPages: 1, leadsPerPage: 1); + foreach ($leads as $lead) { + $this->assertInstanceOf(Lead::class, $lead); + } + $this->assertIsArray(iterator_to_array($leads)); $this->assertEquals(1, $downloadAllLeads->getTotalLeadsProcessed()); }