buckets/tests/Enum/BucketTypeTest.php

33 lines
959 B
PHP
Raw Normal View History

2026-06-18 21:25:39 +02:00
<?php
namespace App\Tests\Enum;
use App\Enum\BucketAllocationType;
use App\Enum\BucketType;
use PHPUnit\Framework\TestCase;
final class BucketTypeTest extends TestCase
{
public function testBucketTypeCasesAndAllowedAllocationTypes(): void
{
$this->assertSame('need', BucketType::NEED->value);
$this->assertSame('want', BucketType::WANT->value);
$this->assertSame('overflow', BucketType::OVERFLOW->value);
$this->assertSame(
[BucketAllocationType::FIXED_LIMIT, BucketAllocationType::PERCENTAGE],
BucketType::NEED->getAllowedAllocationTypes(),
);
$this->assertSame(
[BucketAllocationType::FIXED_LIMIT, BucketAllocationType::PERCENTAGE],
BucketType::WANT->getAllowedAllocationTypes(),
);
$this->assertSame(
[BucketAllocationType::UNLIMITED],
BucketType::OVERFLOW->getAllowedAllocationTypes(),
);
}
}