<?php

declare(strict_types=1);

namespace Drupal\Tests\flowdrop_trigger\Unit\Enum;

use Drupal\Tests\UnitTestCase;
use Drupal\flowdrop_trigger\Enum\TriggerPriority;
use Drupal\Tests\flowdrop\Unit\Traits\EnumContractTestTrait;

/**
 * Tests the TriggerPriority enum.
 *
 * @coversDefaultClass \Drupal\flowdrop_trigger\Enum\TriggerPriority
 * @group flowdrop_trigger
 */
class TriggerPriorityTest extends UnitTestCase {

  use EnumContractTestTrait;

  /**
   * @covers \Drupal\flowdrop_trigger\Enum\TriggerPriority
   */
  public function testCasesAndValues(): void {
    $this->assertBackedEnumValues(TriggerPriority::class, [
      'Low' => 'low',
      'Normal' => 'normal',
      'High' => 'high',
      'Critical' => 'critical',
    ]);
  }

  /**
   * @covers ::label
   */
  public function testLabels(): void {
    $this->assertEquals('Low', TriggerPriority::Low->label());
    $this->assertEquals('Normal', TriggerPriority::Normal->label());
    $this->assertEquals('High', TriggerPriority::High->label());
    $this->assertEquals('Critical', TriggerPriority::Critical->label());
  }

}
