File: /home/xedaptot/ai.naniguide.com/tests/Feature/WarmupStrategyFeatureTest.php
<?php
/**
* WarmupStrategy model feature tests.
*/
use App\Model\WarmupStrategy;
test('warmup strategy growth modes are defined', function () {
expect(WarmupStrategy::GROWTH_STRATEGY_LINEAR)->toBe('linear');
expect(WarmupStrategy::GROWTH_STRATEGY_EXPONENTIAL)->toBe('exponential');
});
test('warmup strategy limit types are defined', function () {
expect(WarmupStrategy::LIMIT_TYPE_PER_DAY_CAP)->toBe('per_day_cap');
expect(WarmupStrategy::LIMIT_TYPE_TARGET_VOLUME)->toBe('target_volume');
expect(WarmupStrategy::LIMIT_TYPE_STOP_AFTER_DAYS)->toBe('stop_after_days');
});
test('warmup strategy model accepts configuration', function () {
$strategy = new WarmupStrategy([
'name' => 'Gradual Ramp',
'starting_volume' => 50,
'growth_strategy' => WarmupStrategy::GROWTH_STRATEGY_LINEAR,
'linear_increment' => 25,
'limit_type' => WarmupStrategy::LIMIT_TYPE_PER_DAY_CAP,
'limit_value' => 1000,
'skip_weekends' => true,
]);
expect($strategy->name)->toBe('Gradual Ramp');
expect((int) $strategy->starting_volume)->toBe(50);
expect($strategy->growth_strategy)->toBe(WarmupStrategy::GROWTH_STRATEGY_LINEAR);
});