HEX
Server: LiteSpeed
System: Linux s1049.use1.mysecurecloudhost.com 4.18.0-477.27.2.lve.el8.x86_64 #1 SMP Wed Oct 11 12:32:56 UTC 2023 x86_64
User: xedaptot (3356)
PHP: 8.3.31
Disabled: NONE
Upload Files
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);
});