CaiWuXiTong/tests/Unit/Deployment/PromotionExpenseScheduleTest.php

25 lines
946 B
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);
$schedule = '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);
$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);
}
}