<?php

declare(strict_types=1);

namespace Drupal\Tests\flowdrop\Unit\Constants;

use Drupal\Tests\UnitTestCase;
use Drupal\flowdrop\Constants\EdgeKeys;
use Drupal\flowdrop\Constants\PortDirection;

/**
 * Tests that constant values remain stable across releases.
 *
 * @group flowdrop
 */
class ConstantsContractTest extends UnitTestCase {

  /**
   * Asserts EdgeKeys constant values are stable.
   *
   * @covers \Drupal\flowdrop\Constants\EdgeKeys
   */
  public function testEdgeKeysValues(): void {
    $this->assertEquals('sourceHandle', EdgeKeys::SOURCE_HANDLE);
    $this->assertEquals('targetHandle', EdgeKeys::TARGET_HANDLE);
    $this->assertEquals('is_trigger', EdgeKeys::IS_TRIGGER);
    $this->assertEquals('is_loopback', EdgeKeys::IS_LOOPBACK);
    $this->assertEquals('branch_name', EdgeKeys::BRANCH_NAME);
    $this->assertEquals('source', EdgeKeys::SOURCE);
    $this->assertEquals('target', EdgeKeys::TARGET);
    $this->assertEquals('edge_id', EdgeKeys::EDGE_ID);
  }

  /**
   * Asserts PortDirection constant values are stable.
   *
   * @covers \Drupal\flowdrop\Constants\PortDirection
   */
  public function testPortDirectionValues(): void {
    $this->assertEquals('input', PortDirection::INPUT);
    $this->assertEquals('output', PortDirection::OUTPUT);
    $this->assertEquals('inputs', PortDirection::INPUTS);
    $this->assertEquals('outputs', PortDirection::OUTPUTS);
  }

}
