<?php

use App\Traits\Enum\WithValue;

enum TestValueEnum: string
{
    use WithValue;

    case ACTIVE = 'active';
    case INACTIVE = 'inactive';
}

describe('WithValue Trait', function () {
    it('can get all values from enum cases', function () {
        $values = TestValueEnum::values();

        expect($values)->toBeArray()
            ->and($values)->toEqual(['active', 'inactive'])
            ->and($values)->toHaveCount(2);
    });

    it('returns correct value types', function () {
        $values = TestValueEnum::values();

        foreach ($values as $value) {
            expect($value)->toBeString();
        }
    });
});
