<?php

namespace Tests\Unit\Models;

use App\Models\Competition;
use PHPUnit\Framework\TestCase;
use Illuminate\Database\Eloquent\SoftDeletes;

class CompetitionTest extends TestCase
{
    public function test_model_metadata_is_converted(): void
    {
        $model = new Competition();

        $this->assertSame('competitions', $model->getTable());
        $this->assertSame('id', $model->getKeyName());
        $this->assertSame(true, $model->timestamps);
        $this->assertSame(["title", "semester", "school_year", "class_section_id", "start_date", "end_date", "winners_count", "prize_per_point", "is_published", "published_at", "created_by", "created_at", "updated_at", "deleted_at", "is_locked", "locked_at", "locked_by"], $model->getFillable());
    }

    public function test_model_class_loads(): void
    {
        $this->assertInstanceOf(Competition::class, new Competition());
        $this->assertContains(SoftDeletes::class, class_uses_recursive(Competition::class));
    }
}
