CaiWuXiTong/tests/Unit/EcommerceFinance/BillPerformanceResyncDispatcherTest.php

31 lines
922 B
PHP

<?php
namespace Tests\Unit\EcommerceFinance;
use Mockery;
use Modules\EcommerceFinance\Services\AccountMappingResyncDispatcher;
use Modules\EcommerceFinance\Services\BillPerformanceResyncDispatcher;
use Tests\TestCase;
class BillPerformanceResyncDispatcherTest extends TestCase
{
public function test_it_queues_every_month_covered_by_an_imported_period(): void
{
$queue = Mockery::mock(AccountMappingResyncDispatcher::class);
$queue->shouldReceive('dispatchPlatformMonths')
->once()
->with([
'taobao-wechat' => ['2026-10', '2026-11'],
])
->andReturn(['jobs' => 2]);
$result = (new BillPerformanceResyncDispatcher($queue))
->dispatch('taobao-wechat', '2026-10-29', '2026-11-02');
$this->assertSame([
'jobs' => 2,
'months' => ['2026-10', '2026-11'],
], $result);
}
}