true, 'output' => 'ok']; }, ); $result = $service->refresh('2026-10', 'taobao-alipay'); $this->assertSame('succeeded', $result['status']); $this->assertSame(['taobao-alipay'], $result['platforms']); $this->assertCount(1, $calls); $this->assertContains('store-receipt:product-cost:sync', $calls[0]); $this->assertContains('2026-10', $calls[0]); $this->assertContains('--platform=taobao-alipay', $calls[0]); } public function test_it_reports_a_failed_product_cost_refresh(): void { $service = new ProductCostAutoRefresh( static fn (array $command): array => ['success' => false, 'output' => 'failed'], ); $result = $service->refresh('2026-10', 'pinduoduo'); $this->assertSame('failed', $result['status']); $this->assertFalse($result['results'][0]['success']); } public function test_it_rejects_an_invalid_month(): void { $this->expectException(InvalidArgumentException::class); (new ProductCostAutoRefresh())->refresh('2026-10-01', 'taobao-alipay'); } }