32 lines
959 B
PHP
32 lines
959 B
PHP
<?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(),
|
|
);
|
|
}
|
|
}
|