<?php

declare(strict_types=1);

namespace Drupal\Tests\flowdrop_trigger\Unit\Enum;

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

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

  use EnumContractTestTrait;

  /**
   * @covers \Drupal\flowdrop_trigger\Enum\PipelineMode
   */
  public function testCasesAndValues(): void {
    $this->assertBackedEnumValues(PipelineMode::class, [
      'New' => 'new',
      'Reuse' => 'reuse',
      'Singleton' => 'singleton',
    ]);
  }

  /**
   * @covers ::label
   */
  public function testLabels(): void {
    $this->assertEquals('New Pipeline', PipelineMode::New->label());
    $this->assertEquals('Reuse Pipeline', PipelineMode::Reuse->label());
    $this->assertEquals('Singleton', PipelineMode::Singleton->label());
  }

}
