CaiWuXiTong/tests/Unit/Deployment/PromotionExpenseScheduleTest.php
yueyang 411e3376d2 feat(财务分析): 推广费用改用数据库 push_fee 镜像 (#1618)
合并 PR #1618:财务经营分析推广费用改读数据库共享镜像,不再依赖聚水潭开放平台 Key。
2026-12-01 17:46:18 +08:00

29 lines
1.0 KiB
PHP

<?php
namespace Tests\Unit\Deployment;
use PHPUnit\Framework\TestCase;
class PromotionExpenseScheduleTest extends TestCase
{
public function test_release_and_batch_scripts_schedule_promotion_expense_sync(): void
{
$root = dirname(__DIR__, 3);
$schedules = [
'10 3 * * * root /usr/bin/timeout 1800 /bin/sh /opt/caiwuxitong/run-finance-batch.sh business-mirror:sync-promotion-expenses --days=7 --quiet',
];
foreach (['deploy/activate-release.sh', 'deploy/activate-incremental-release.sh'] as $file) {
$contents = file_get_contents($root . '/' . $file);
$this->assertIsString($contents);
foreach ($schedules as $schedule) {
$this->assertStringContainsString($schedule, $contents, $file);
}
}
$runner = file_get_contents($root . '/deploy/run-finance-batch.sh');
$this->assertIsString($runner);
$this->assertStringContainsString('business-mirror:sync-promotion-expenses', $runner);
}
}